Trying to unlock Web Audio on both touchstart and touchend events

This commit is contained in:
Pavle Goloskokovic 2017-11-30 14:39:24 +01:00
parent 26956d3172
commit 1b94d7eac3

View file

@ -67,9 +67,11 @@ var WebAudioSoundManager = new Class({
var _this = this;
if (this.context.state === 'suspended') {
var unlock_1 = function () {
document.body.removeEventListener('touchstart', unlock_1);
document.body.removeEventListener('touchend', unlock_1);
_this.context.resume();
};
document.body.addEventListener('touchstart', unlock_1, false);
document.body.addEventListener('touchend', unlock_1, false);
}
},