Hello!
I found a bug! Just a notice. The problem can be solved another way.
The Sound.stop() doesn't work as described in API.
<audio id="bgMusic" src="/sounds/mus.mp3" autoplay loop></audio>
function muteSound(sound) {
sound.stop();
}
bgMusic = new gamejs.audio.Sound(document.getElementById("bgMusic"));
muteSound(bgMusic);
So, it cause an error "audio.stop is not a function".
The solution is to use standard JavaScript methods.
bgMusic = document.getElementById("bgMusic");
muteSound(bgMusic);
function muteSound(sound) {
sound.pause();
}