From d8e36615e790f85e45ce38e963b780d4fb6d7af3 Mon Sep 17 00:00:00 2001 From: Pavle Goloskokovic Date: Wed, 17 Jan 2018 17:35:08 +0100 Subject: [PATCH] Gathering all actions and performing them sequentially --- src/sound/html5/HTML5AudioSoundManager.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/sound/html5/HTML5AudioSoundManager.js b/src/sound/html5/HTML5AudioSoundManager.js index 00daf95ec..e76b82bee 100644 --- a/src/sound/html5/HTML5AudioSoundManager.js +++ b/src/sound/html5/HTML5AudioSoundManager.js @@ -130,6 +130,22 @@ var HTML5AudioSoundManager = new Class({ if (this.touchUnlocked) { this.touchUnlocked = false; this.touchLocked = false; + var allSoundsTouchLockedActionQueue_1 = []; + this.forEachActiveSound(function (sound) { + sound.touchLockedActionQueue.forEach(function (touchLockedAction) { + allSoundsTouchLockedActionQueue_1.push(touchLockedAction); + }); + }); + allSoundsTouchLockedActionQueue_1.forEach(function (touchLockedAction) { + switch (touchLockedAction.type) { + case 'method': + touchLockedAction.sound[touchLockedAction.name].apply(touchLockedAction.sound, touchLockedAction.value || []); + break; + case 'property': + touchLockedAction.sound[touchLockedAction.name] = touchLockedAction.value; + break; + } + }); } BaseSoundManager.prototype.update.call(this); },