From b806d66e0d7a469324fc56f211389ed45a472077 Mon Sep 17 00:00:00 2001 From: Pavle Goloskokovic Date: Mon, 8 Jan 2018 14:04:21 +0100 Subject: [PATCH] Dispatching seek event after the source has been updated --- v3/src/sound/webaudio/WebAudioSound.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v3/src/sound/webaudio/WebAudioSound.js b/v3/src/sound/webaudio/WebAudioSound.js index b1d40b87b..dd344503a 100644 --- a/v3/src/sound/webaudio/WebAudioSound.js +++ b/v3/src/sound/webaudio/WebAudioSound.js @@ -491,12 +491,12 @@ Object.defineProperty(WebAudioSound.prototype, 'seek', { if (this.isPlaying || this.isPaused) { value = Math.min(Math.max(0, value), this.duration); this.currentConfig.seek = value; + if (this.isPlaying) { + this.stopAndRemoveBufferSource(); + this.createAndStartBufferSource(); + } this.events.dispatch(new SoundValueEvent(this, 'SOUND_SEEK', value)); } - if (this.isPlaying) { - this.stopAndRemoveBufferSource(); - this.createAndStartBufferSource(); - } } }); /**