Copy link to clipboard
Copied
I want to add a "Rewind 30 seconds" to a slide containing a slide video. While I have found some sample Javascript that looks like it might work, I have not been able to get it to work yet. I saw someplace that getCurrentFrame was deprecated under Captivate 12.x. The broader question would be, does anyone know where there is a reference manual for the objects, methods, and properties associated with the Javascript implementation in the new Captivate? The more specific question would be if anyone has seen code that might get me in the ballpark for this "Rewind 30 seconds" Javascript. Thank you!
Copy link to clipboard
Copied
Here is a simplified version of the Javascript I was using. This should rewind the timeline by 3 seconds.
// Get the current slide using the Common JavaScript Interface
var currentSlide = window.cpAPIInterface.getVariableValue("cpInfoCurrentSlide");
// Get the current frame
var currentFrame = window.cpAPIInterface.getVariableValue("cpInfoCurrentFrame");
currentFrame = currentFrame - 90;
// Use the undocumented cpCmndGotoFrame variable to set the frame
window.cpAPIInterface.cpCmndGotoFrameAndResume(currentSlide, targetFrame);