Thank you.... trying to find out in JavaScript how to capture the event when the objects getting paused in Captivate. If it can be captured, then the custom Play/Pause button also can be manipulated.
You can use Captivate's js api to set up event listeners that would capture the events for pausing and resuming, and then do things whenever that happens (e.g. change your play/pause button state), and also write the current play/pause state to a user variable that wold at any time reflect if the movie is currently playing or paused, to be quried beween the actual events (much like an Info System Variable).
Say you have a custom play/paused button labeled 'playPauseButton' with two states named 'Playing' and 'Paused', and you created a boolean user variable 'v_isPaused' that is supposed to have the value 'false' when the movie is playing and 'true' when the movie is paused. Put this on an 'On Enter' action on the first slide:
window.cpAPIEventEmitter.addEventListener('CPAPI_MOVIESTART',setIsPlaying);
window.cpAPIEventEmitter.addEventListener('CPAPI_MOVIEPAUSE',setIsPaused);
window.cpAPIEventEmitter.addEventListener('CPAPI_MOVIERESUME',setIsPlaying);
function setIsPaused() {
v_isPaused = true;
cp.changeState('playPauseButton','Paused');
}
function setIsPlaying() {
v_isPaused = false;
cp.changeState('playPauseButton','Playing');
}
That should take care of the correct state change of the button, no matter by which means the slide was paused/resumed.
You can built out the action that would toggle the 'playPauseButton' between pausing and resuming the slide as conditional, depending on the current value of the 'v_isPaused' variable.