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
141 Replies
- JasonEggert-270Community Member
Thank you so much! This is awesome!
- TehreemHassanCommunity Member
thanks for help
- NishadKulkarniCommunity Member
A life saver code.
var appState = require("helpers/appState");
appState.onToggleVolume();//muteThanks to whoever came up with this solution.
- NicoleRalph-117Community Member
Thank you very much for the code Naku
- AloysiusDomnicCommunity Member
Hi Naku,
Can you please suggest how to add this 'lifesaver code' in Tuggle mute/unmute button.
It will be more understandable if you share SL file for an example.
- MarekMacionga-8Community Member
Hi!
This week I updated storyline 360 and Javascript no longer works.
Trainings published before the update are ok, but those after the update do not work properly.
Do you have a solution for this? - ErnestoRaymundoCommunity Member
Same here. The scripts that I used last year are not working now.
- SebastianMengayCommunity Member
Having the same problem. Getting an error "require is not defined" in the Developer Console. Any quick fix for this?
- NigelThorne-bb2Community Member
This has been working for me. Add to a javascript trigger:
DS.appState.onToggleVolume();
- RHoisanCommunity Member
Dear Nigel, you are a life saver. I was looking to make my custom volume buttons work for quite some time.
This does the trick. Let's hope it will last for future Storyline updates...
DS.appState.onToggleVolume();
- DanShannon-73c9Community Member
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-bb2Community 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-73c9Community 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
Related Content
- 9 months ago