espace Posted November 22, 2017 Share Posted November 22, 2017 hi, I have this piece of code to play my ambiance music. these function is on the top of my state to be accessible trough all the different states. Everything works fine expect when i leave the game on my phone. The music is still playing. What's the syntax for the event : to say "we leave the game" then stop the music with music_ambiance.pause(); ? var music_ambiance=new Audio('sounds/music_ambiance/mus.ogg'); music_ambiance.loop=true; music_ambiance.volume=0.20; music_ambiance.play(); //for pause //music_ambiance.pause(); music_ambiance_mute=function(){ music_ambiance.volume=0; }; music_ambiance_activate=function(){ music_ambiance.volume=0.20; }; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.