Skip to main content
Inspiring
March 14, 2018
Answered

audio event listeners in Captivate?

  • March 14, 2018
  • 2 replies
  • 636 views

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 topic has been closed for replies.
Correct answer anton9800

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

2 replies

digitaly
Participating Frequently
November 21, 2018

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.

anton9800AuthorCorrect answer
Inspiring
March 15, 2018

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