Copy link to clipboard
Copied
Hello! Is there a way to attach event listeners to audio clips inside Captivate? I need to trigger some events when audio ends, and prefer to do it without setting timeouts or waiting for a manually entered frame.
Thank you very much!
this.onEndedCallBackFn function inside CPM.js does this - from there I was able to toggle all that I needed on audio end for every slide
Copy link to clipboard
Copied
this.onEndedCallBackFn function inside CPM.js does this - from there I was able to toggle all that I needed on audio end for every slide
Copy link to clipboard
Copied
I realize this question already has an accepted answer and that is a good solution, but I thought I'd throw in what I learned in case anyone doesn't care to mess with CPM.js files.
I used:
aud = cp.movie.audioManager.currentSlideAudio;
audHandle = cp.movie.audioManager.slideAudios[aud].nativeAudio;
audHandle.onended = function(){
//do stuff
}
to an on slide enter action to add an event listener to the slide audio for that slide.