From aacd7a972df0e5f0eca15b1ce81a5d50eaf057d9 Mon Sep 17 00:00:00 2001 From: Pavle Goloskokovic Date: Wed, 17 Jan 2018 19:03:16 +0100 Subject: [PATCH] Setting lockedActionsQueue value based on locked property value --- src/sound/html5/HTML5AudioSoundManager.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sound/html5/HTML5AudioSoundManager.js b/src/sound/html5/HTML5AudioSoundManager.js index 776685201..6588ec68e 100644 --- a/src/sound/html5/HTML5AudioSoundManager.js +++ b/src/sound/html5/HTML5AudioSoundManager.js @@ -46,6 +46,7 @@ var HTML5AudioSoundManager = new Class({ * @default [] */ this.onBlurPausedSounds = []; + this.locked = 'ontouchstart' in window; /** * A queue of all actions performed on sound objects while audio was locked. * Once the audio gets unlocked, after an explicit user interaction, @@ -57,9 +58,8 @@ var HTML5AudioSoundManager = new Class({ * name: string, * value?: any, * }[]} lockedActionsQueue - * @default [] */ - this.lockedActionsQueue = []; + this.lockedActionsQueue = this.locked ? [] : null; /** * Property that actually holds the value of global mute * for HTML5 Audio sound manager implementation. @@ -78,7 +78,6 @@ var HTML5AudioSoundManager = new Class({ * @default 1 */ this._volume = 1; - this.locked = 'ontouchstart' in window; BaseSoundManager.call(this, game); }, add: function (key, config) {