Forum Discussion
Background Music Demo
As I said above I used your code Jackson and it worked great. But do you have an idea on how I could use the built-in pause control to have the music pause as well? (with your code only the slides pause when user click on the built in pause button but not the music).
Thanks in advance!! Ryan
- JacksonHamner9 years agoCommunity Member
I don't think there is a way to add a trigger to the player's play/pause button. The only way to have both actions triggered with the same button is to make a custom button for it. What would probably work is to have a button that has the trigger "Pause timeline when user clicks" as well as a "Execute Javascript when user clicks" trigger.You would want the javascript to mute the music (I haven't found a good way to pause audio for real), so this code should work:
var audio = document.getElementById('bgSong');
audio.volume = 0.0;
And when you want it to play again have the button execute another script that sets the volume back to normal:
var audio = document.getElementById('bgSong');
audio.volume = 1.0;
Here is a topic about making a custom play/pause button. Just add the scripts to the button triggers and it should work. https://community.articulate.com/discussions/articulate-storyline/pause-play-button-questionLet me know if you run into any problems, I hope this helps!