Javascript to MUTE audio?

Aug 09, 2012

Is it possible to MUTE audio in Storyline? I'm working on a course with a ground-up custom interface with a button that's supposed to mute/unmute - not pause/play or stop/play - the audio.

Are there any Javascript gurus out there who know if this is possible? And if so, can you provide the scripts for mute and unmute? That would SO make my day.

Dazed and confused...

Patrice

141 Replies
M K

Hi,

I just observed that this flash-javaScript workaround doesn't work on Firefox or Chrome. It only works on IE. I downloaded the muteToggler attachment from this thread and published it and noticed that it only works on IE. Following are the details.

Storyline version used to publish:Update 3: 1305.2012

IE 8 + Flash Player 11.8.800.94  (works fine)

FF v23.0.1 + Flash Player 11.8.800.97 (doesn't work)

Chrome v29.0.1547.66 + Flash Player 11.8.800.97 (doesn't work)

Has anybody experienced same issue?

Thanks in advance

MK

Electron Karthick

M K said:

By the way, looking for a solution to implement mute/ unmute in HTML5 output. any help on the same will be greatly appreciated.

Thanks

MK


You can use a trigger to execute this javascript code on HTML5 mode,

$('audio').each(function(){

this.pause();

});

This will pause all the audio which are active. You can execute this on conditional basis (say when timeline starts if variable audio = false) then call this code otherwise let the audio to play by default.

Electron Karthick

Electron Media said:

M K said:

By the way, looking for a solution to implement mute/ unmute in HTML5 output. any help on the same will be greatly appreciated.

Thanks

MK


You can use a trigger to execute this javascript code on HTML5 mode,

$('audio').each(function(){

this.pause();

});

This will pause all the audio which are active. You can execute this on conditional basis (say when timeline starts if variable audio = false) then call this code otherwise let the audio to play by default.


By the way, i have accidentally pressed the suggested answer button on your reply. Could not find a way to undo it. Sorry about that!

julie wynn

Steve Flowers said:

OK, my friends. Here's a quick example and widget that will let you mute all audio. Note that this won't work in Preview or in HTML5 or iOS publish. It's Flash based and requires that you publish. If it doesn't work locally you may also need to add your publish folder to the Flash player security settings.


This does use JavaScript as an intermediary so that Flash can pick up variable change conditions from Storyline. Pretty straight forward. Let me know if you have any problems.


Hello,

Is it possible to add the Javascript HTML5 mute toogle into this sample file as well?

Much appreciated

Julie

Steve Prud'Homme CSDL

Steve Flowers said:

OK, my friends. Here's a quick example and widget that will let you mute all audio. Note that this won't work in Preview or in HTML5 or iOS publish. It's Flash based and requires that you publish. If it doesn't work locally you may also need to add your publish folder to the Flash player security settings.


This does use JavaScript as an intermediary so that Flash can pick up variable change conditions from Storyline. Pretty straight forward. Let me know if you have any problems.

Ok can i do this with a button in the player ? Or do I have to put the button on each slide ? I have a SCORM with 277 slide and I want to win some time !