have you had a look at the sample file I uploaded in the threat Matthew referenced above? You should be able to create a single mute/unmute toggle button for multiple audios with that and the script I posted later in that thread:
var allAudios = document.getElementsByTagName('audio');
if (allAudios[0].volume > 0) { for (var a = 0; a < allAudios.length; a++) { allAudios[a].volume = 0; } } else { for (var a = 0; a < allAudios.length; a++) { allAudios[a].volume = 1.0; } }
Hi David,
Thank you so much for your reply.
in your coding only work HTML5 output.but i want my file working with both
HTML5 and flash.
you have any idea about this.
pls help me......
var allAudios = document.getElementsByTagName('audio'); if (allAudios[0].volume > 0) { for (var a = 0; a < allAudios.length; a++) { allAudios[a].volume = 0; } } else { for (var a = 0; a < allAudios.length; a++) { allAudios[a].volume = 1.0; } Hi David, This code is not working when I view the course online/On web server in Chrome browser.
This thread is a bit dated and I'm not sure if David is still subscribed here. You are certainly welcome to reach out to the user directly via the 'Contact Me' option on the user profile if you do not hear back soon.
Sudhakar, check out the article below for instructions. Make sure you use the code for Storyline 3 and not Storyline 2. Let me know if you need any more help.
14 Replies
Hi Matthew,
thanks for your reply.
i will check.
Hi Anitha,
have you had a look at the sample file I uploaded in the threat Matthew referenced above? You should be able to create a single mute/unmute toggle button for multiple audios with that and the script I posted later in that thread:
For javascript integration in general, there's an introduction by Articulate: https://articulate.com/support/article/javascript-best-practices-and-examples
Hi David,
Thank you so much for your reply.
in your coding only work HTML5 output.but i want my file working with both
HTML5 and flash.
you have any idea about this.
pls help me......
thank you,
Anitha
For Flash there's the mutetoggler script you can find here: https://community.articulate.com/discussions/articulate-storyline/javascript-to-mute-audio#95681
sadly, there's no universal solution
Thanks, David, for the support!
hi david,
i have one problem....
when i click mute button my first audio sound off.when my timeline reach second audio it will automatically play.how to rectify this problem.
can you please see this video.
thank you
Anitha,
var allAudios = document.getElementsByTagName('audio');
if (allAudios[0].volume > 0) {
for (var a = 0; a < allAudios.length; a++) {
allAudios[a].volume = 0;
}
} else {
for (var a = 0; a < allAudios.length; a++) {
allAudios[a].volume = 1.0;
}
Hi David, This code is not working when I view the course online/On web server in Chrome browser.
Please let me know if there any solution.
Thanks,
Swapnil
Hello Swapnil,
This thread is a bit dated and I'm not sure if David is still subscribed here. You are certainly welcome to reach out to the user directly via the 'Contact Me' option on the user profile if you do not hear back soon.
Swapnil, which version of Storyline are you using?
Hi Anderson,
We are using SL3 version and finding a solution for Mute/Unmute JavaScript button for audio control.
Can you please help us out.
Regards
S
Sudhakar, check out the article below for instructions. Make sure you use the code for Storyline 3 and not Storyline 2. Let me know if you need any more help.
http://greladesign.com/blog/2017/10/11/storyline-360-custom-volume-control/
Thank you for your help Anderson.
This discussion is closed. You can start a new discussion or contact Articulate Support.