mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Removing touche events when unlocking only after promise returned from resume method gets resolved
This commit is contained in:
parent
5f21646e6c
commit
9ec1fb4cd1
1 changed files with 4 additions and 3 deletions
|
@ -67,9 +67,10 @@ 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();
|
||||
_this.context.resume().then(function () {
|
||||
document.body.removeEventListener('touchstart', unlock_1);
|
||||
document.body.removeEventListener('touchend', unlock_1);
|
||||
});
|
||||
};
|
||||
document.body.addEventListener('touchstart', unlock_1, false);
|
||||
document.body.addEventListener('touchend', unlock_1, false);
|
||||
|
|
Loading…
Reference in a new issue