Skip to main content
Participating Frequently
October 31, 2024
Question

Javascript changes in Captivate 12.x

  • October 31, 2024
  • 1 reply
  • 256 views

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!

This topic has been closed for replies.

1 reply

Participating Frequently
October 31, 2024

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);