Forum Discussion
Javascript to MUTE audio?
I'm new to JS, but want to learn.
Can someone take me through the process of writing the script for a toggle mute/unmute button?
- NigelThorne-bb25 years agoCommunity Member
Hi Dan,
Almost nothing to this. Just create a button and add an Execute javascript trigger. In the javascript panel of the trigger just add DS.appState.onToggleVolume();
That's all you need to do. It will not work in preview but will once it's on a server or LMS.
Cheers,
Nigel
- DanShannon-73c95 years agoCommunity Member
Hi Nigel,
Putting a Storyline on the LMS is kind of a big deal in my organization.
Will it work on Review 360 or if I save the file folder to my computer?
I won't be insulted if you dumb it down.
Thanks,
Dan
- DanShannon-73c95 years agoCommunity Member
You say it won't work in "preview", which I take to mean the specific Preview mode available from the Slide interface.
So, here's what I need to know.
Will it work in any of the other ways that one would use to "preview", such as Review 360 or Web?
In some ways, either of these preview options could be considered a server, in a sense.
I tried both ways, though, and neither worked at all.
This is where providing a more thorough explanation would probably save time in the long run.
As I've said, putting an eLearning on a server or LMS is actually a pretty big deal in my organization and I'd like to be able to test its functionality before I do that.
Thanks again.
Dan
- NishadKulkarni5 years agoCommunity Member
Hello,
As far as I know none of the javascripts in general works in preview. You have to publish the course either locally, review360 or LMS. Any javascript will work in published versions.
Again JS does not work in preview.
Hope that helps.
- DianeWestern-0d2 years agoCommunity Member
Thank you! Seems to work in Modern Player:
DS.appState.onToggleVolume();