Skip to content

Commit c2d661f

Browse files
Unlocking Web Audio sound manager immediately in its constructor
1 parent 403f5b3 commit c2d661f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ var WebAudioSoundManager = new Class({
7676
this.locked = this.context.state === 'suspended' && 'ontouchstart' in window;
7777

7878
BaseSoundManager.call(this, game);
79+
80+
if (this.locked)
81+
{
82+
this.unlock();
83+
}
7984
},
8085

8186
/**
@@ -145,6 +150,7 @@ var WebAudioSoundManager = new Class({
145150
{
146151
document.body.removeEventListener('touchstart', unlock);
147152
document.body.removeEventListener('touchend', unlock);
153+
148154
_this.unlocked = true;
149155
});
150156
};

0 commit comments

Comments
 (0)