Forum Discussion
JacksonHamner
10 years agoCommunity Member
Background Music Demo
I made a demo featuring background music that goes through the whole course (doesn't change from slide to slide). The user can chose from four songs to listen to and can adjust the volume, and the s...
JacksonHamner
10 years agoCommunity Member
You're right, I was confused with what I did in the past to make this happen. What I did was not stop the audio but turn the volume all the way down.
So this trigger should stop the music from playing:
var audio = document.getElementById('bgSong');
audio.volume = 0.0;
When you want the audio to start playing again you can set the volume back up.