Skip to content

Commit 99aa2b2

Browse files
Resetting sound playback at seek time if sound is playing
1 parent 06b7ad9 commit 99aa2b2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ Object.defineProperty(WebAudioSound.prototype, 'seek', {
262262
set: function (value) {
263263
value = Math.min(Math.max(0, value), this.duration);
264264
this.currentConfig.seek = value;
265+
if (this.isPlaying) {
266+
this.stopAndRemoveBufferSource();
267+
this.createAndStartBufferSource();
268+
}
265269
}
266270
});
267271
module.exports = WebAudioSound;

0 commit comments

Comments
 (0)