Forum Discussion
Javascript to MUTE audio?
Ajay have you got solution?
Hi Ravindra,
Yes I got the solution in another thread, I am posting the solution here too so you can see here.
to mute audio I have used this code and it is working fine:
if (document.location.href.indexOf('html5') < 0) {
} else {
var player = GetPlayer();
Audio.setMasterVolume(0);
$('audio').prop('volume','0');
}
to unmute audio I have used this code and it is working fine:
if (document.location.href.indexOf('html5') < 0) {
} else {
var player = GetPlayer();
Audio.setMasterVolume(0.8);
$('audio').prop('volume','0.8');
}
the condition mentioned above ensures that these commands work only in HTML5 version of the course.
- anithaduraisamy8 years agoCommunity Member
Hi Ajay,
i am new to articulate.
How to use this code?
where to use this code?
can you help me please......
thank you,
Anitha
- AjayKhatri8 years agoCommunity Member
Hi Anitha
This code is applied to triggers on the audio on/off buttons.
on audio off/mute button, add a new trigger and select execute Javascript and paste the following code:
if (document.location.href.indexOf('html5') < 0) {
} else {var player = GetPlayer();
Audio.setMasterVolume(0);
$('audio').prop('volume','0');
}On audio on button,
add a new trigger and select execute Javascript and paste the following code:
if (document.location.href.indexOf('html5') < 0) {
} else {var player = GetPlayer();
Audio.setMasterVolume(0.8);
$('audio').prop('volume','0.8');
}please note that this code will work only in HTML 5 version of the publish course content.
and for Flash version of the published content you can use the mute toggler as explained in this thread.
give me a shout if you need any more help in Articulate Storyline.
Regards
Ajay Khatri
- anithaduraisamy8 years agoCommunity Member
Hi Ajay,
Thanks for your reply.
And in this coding only work in HTML5 output.but i want my file working
both html and flash.
you have any idea about this.Thank you,
Anitha
- MayurRaskar-c868 years agoCommunity Member
not working yet. can you show me video or screenshots.
- AjayKhatri8 years agoCommunity Member
Hi Mayur,
Can you tell me what is the exact problem you are facing in implementation.
Sorry I am little busy these days so couldn't reply earlier.
Ajay