mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 05:58:30 +00:00
Saving seek value only when sound is playing or paused, for consistency
This commit is contained in:
parent
8d161ac06d
commit
b5e8a60530
1 changed files with 4 additions and 2 deletions
|
@ -266,8 +266,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.isPaused) {
|
||||
value = Math.min(Math.max(0, value), this.duration);
|
||||
this.currentConfig.seek = value;
|
||||
}
|
||||
if (this.isPlaying) {
|
||||
this.stopAndRemoveBufferSource();
|
||||
this.createAndStartBufferSource();
|
||||
|
|
Loading…
Add table
Reference in a new issue