Open Joncom opened 5 years ago
diff --git a/lib/impact/sound.js b/lib/impact/sound.js index 50d74be..afcc7a4 100644 --- a/lib/impact/sound.js +++ b/lib/impact/sound.js @@ -34,13 +34,13 @@ ig.SoundManager = ig.Class.extend({ if( ig.Sound.enabled && ig.Sound.useWebAudio ) { this.audioContext = new AudioContext(); this.boundWebAudioUnlock = this.unlockWebAudio.bind(this); - document.addEventListener('touchstart', this.boundWebAudioUnlock, false); + ig.system.canvas.addEventListener('touchstart', this.boundWebAudioUnlock, false); } }, unlockWebAudio: function() { - document.removeEventListener('touchstart', this.boundWebAudioUnlock, false); + ig.system.canvas.removeEventListener('touchstart', this.boundWebAudioUnlock, false); // create empty buffer var buffer = this.audioContext.createBuffer(1, 1, 22050);