mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Resetting sound playback at seek time if sound is playing
This commit is contained in:
parent
06b7ad91fd
commit
99aa2b22c4
1 changed files with 4 additions and 0 deletions
|
@ -262,6 +262,10 @@ Object.defineProperty(WebAudioSound.prototype, 'seek', {
|
|||
set: function (value) {
|
||||
value = Math.min(Math.max(0, value), this.duration);
|
||||
this.currentConfig.seek = value;
|
||||
if (this.isPlaying) {
|
||||
this.stopAndRemoveBufferSource();
|
||||
this.createAndStartBufferSource();
|
||||
}
|
||||
}
|
||||
});
|
||||
module.exports = WebAudioSound;
|
||||
|
|
Loading…
Reference in a new issue