Dispatching seek event after the source has been updated

This commit is contained in:
Pavle Goloskokovic 2018-01-08 14:04:21 +01:00
parent a1bd4e4244
commit b806d66e0d

View file

@ -491,12 +491,12 @@ Object.defineProperty(WebAudioSound.prototype, 'seek', {
if (this.isPlaying || this.isPaused) { if (this.isPlaying || this.isPaused) {
value = Math.min(Math.max(0, value), this.duration); value = Math.min(Math.max(0, value), this.duration);
this.currentConfig.seek = value; this.currentConfig.seek = value;
this.events.dispatch(new SoundValueEvent(this, 'SOUND_SEEK', value));
}
if (this.isPlaying) { if (this.isPlaying) {
this.stopAndRemoveBufferSource(); this.stopAndRemoveBufferSource();
this.createAndStartBufferSource(); this.createAndStartBufferSource();
} }
this.events.dispatch(new SoundValueEvent(this, 'SOUND_SEEK', value));
}
} }
}); });
/** /**