mirror of
https://github.com/photonstorm/phaser
synced 2024-12-04 02:20:23 +00:00
Dispatching seek event after the source has been updated
This commit is contained in:
parent
a1bd4e4244
commit
b806d66e0d
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||||
|
if (this.isPlaying) {
|
||||||
|
this.stopAndRemoveBufferSource();
|
||||||
|
this.createAndStartBufferSource();
|
||||||
|
}
|
||||||
this.events.dispatch(new SoundValueEvent(this, 'SOUND_SEEK', value));
|
this.events.dispatch(new SoundValueEvent(this, 'SOUND_SEEK', value));
|
||||||
}
|
}
|
||||||
if (this.isPlaying) {
|
|
||||||
this.stopAndRemoveBufferSource();
|
|
||||||
this.createAndStartBufferSource();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue