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
- SteveFlowersCommunity Member
Hi, Patrice -
Unfortunately, there's no built in trigger for muting / unmuting audio in Storyline. This would make a dynamite feature request. I think others would also love to see this type of feature.
- PatriceSigmonCommunity Member
Yep, I figured that much. What I'm hoping is that someone knows some Javascript I can use to build custom triggers for mute and unmute.
-phs
- PhilMayorSuper Hero
There is no exposed API so there is no way to mute the storyline player, you need access to a mute function in the player to do this using javascript.
TBH if Steve cannot do it, it cannot be done yet
- stevecicciCommunity Member
Steve, Phil,
does information found at this link give either of you any thoughts if this can be re-written in a way to incorporate as java script in a Storyline trigger?
I am not a javascript writer, so it is somewhat Greek to me.
Thanks.
- SteveFlowersCommunity Member
It's likely possible in the HTML5 version to trigger audio level changes via JavaScript. Currently, in the Flash-based output, volume is controlled through the compiled player and we don't have access to any exposed functions for controlling volume / mute other than the volume control in the built-in navigation bar.
It may be possible to embed a Flash file that would provide global volume control but it wouldn't be linked to the built-in control and I'm not completely sure how reliable it would be. The problem isn't a JavaScript problem
It's a Storyline player issue. It may be possible to workaround it.
I'll grab 15 minutes this afternoon and build / test one. If it works, I'll post the file and instructions for use.
- stevecicciCommunity Member
http://stackoverflow.com/questions/6442427/muting-a-html5-audio-element-using-a-custom-button
I guess it would help if I posted the link.
- PatriceSigmonCommunity Member
Thanks, Steve Flowers, for devoting some time to this. Your Iron Man persona is well-earned!
- SteveFlowersCommunity Member
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.- tamaraspurrrCommunity Member
I am looking for the Javascript? downloaded the FLA and the ZIP. Working in Storyline 2 and need to mute the audio w/o pausing it in Flash and HTML 5 -- found the HTNK 5 solution but trying to get this Flash fix to work.
- PhilMayorSuper Hero
I said if anyone could
Nice ~Steve
- SteveFlowersCommunity Member
I haven't been able to fully download update 1 yet. With my luck the crew added a trigger to accomplish this