Forum Discussion
Javascript to MUTE audio?
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
- MK4Community Member
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
- SteveFlowersCommunity Member
Hey MK - are you running these locally or from a remote host? Sounds like the Flash Player Security Sandbox could be playing its hand.
- MK4Community Member
Hi Steve, yes its working fine on all the browsers when run from a remote host.
Thanks for the input. It helped.
MK
- ElectronKarthicCommunity Member
Glad i found this post! Steve Flowers - Thanks a ton!
- ElectronKarthicCommunity Member
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.
- ElectronKarthicCommunity Member
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! Hi Electron! Thanks for sharing and I can undo that button push No problem!
- juliewynnCommunity Member
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
Hi Julie,
You may want to send Steve a private message if you need additional help with it as I'm not certain he is subscribed, but he did note that it won't work within HTML5.
Thanks Julie for sharing what you ended up using here!