mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Trying to unlock Web Audio on both touchstart and touchend events
This commit is contained in:
parent
26956d3172
commit
1b94d7eac3
1 changed files with 2 additions and 0 deletions
|
@ -67,9 +67,11 @@ var WebAudioSoundManager = new Class({
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (this.context.state === 'suspended') {
|
if (this.context.state === 'suspended') {
|
||||||
var unlock_1 = function () {
|
var unlock_1 = function () {
|
||||||
|
document.body.removeEventListener('touchstart', unlock_1);
|
||||||
document.body.removeEventListener('touchend', unlock_1);
|
document.body.removeEventListener('touchend', unlock_1);
|
||||||
_this.context.resume();
|
_this.context.resume();
|
||||||
};
|
};
|
||||||
|
document.body.addEventListener('touchstart', unlock_1, false);
|
||||||
document.body.addEventListener('touchend', unlock_1, false);
|
document.body.addEventListener('touchend', unlock_1, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue