We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfe6452 commit ba381f8Copy full SHA for ba381f8
1 file changed
src/sound/webaudio/WebAudioSoundManager.js
@@ -147,14 +147,17 @@ var WebAudioSoundManager = new Class({
147
148
var unlockHandler = function unlockHandler ()
149
{
150
- _this.context.resume().then(function ()
+ if (_this.context)
151
152
- document.body.removeEventListener('touchstart', unlockHandler);
153
- document.body.removeEventListener('touchend', unlockHandler);
154
- document.body.removeEventListener('click', unlockHandler);
155
-
156
- _this.unlocked = true;
157
- });
+ _this.context.resume().then(function ()
+ {
+ document.body.removeEventListener('touchstart', unlockHandler);
+ document.body.removeEventListener('touchend', unlockHandler);
+ document.body.removeEventListener('click', unlockHandler);
+
158
+ _this.unlocked = true;
159
+ });
160
+ }
161
};
162
163
if (document.body)
0 commit comments