Skip to content

Instantly share code, notes, and snippets.

@dtauer
Last active May 25, 2016 15:44
Show Gist options
  • Save dtauer/404576f6c550c61a3a37c812fc7d30e9 to your computer and use it in GitHub Desktop.
Save dtauer/404576f6c550c61a3a37c812fc7d30e9 to your computer and use it in GitHub Desktop.
Listening for Captivate play/pause events
//More API documentation here: https://helpx.adobe.com/captivate/using/common-js-interface.html
//You'll want to have this AFTER the captivate file is initialized (e.g. after cpInit() is called)
if(window.cpAPIInterface && window.cpAPIEventEmitter)
{
//add a listener to for pause event
window.cpAPIEventEmitter.addEventListener("CPAPI_MOVIEPAUSE", function(e){
console.log("captivate timeline paused");
});
//add a listener to CPAPI_SLIDEENTER event
window.cpAPIEventEmitter.addEventListener("CPAPI_MOVIERESUME",function(e){
console.log("captivate timeline resumed");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment