mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Resetting config when calling play method only if current call plays different marker than previous (to enable setting seek before replaying same sound)
This commit is contained in:
parent
75d480ffba
commit
1973781052
1 changed files with 4 additions and 1 deletions
|
@ -207,6 +207,7 @@ var BaseSound = new Class({
|
|||
console.error('Sound marker name has to be a string!');
|
||||
return null;
|
||||
}
|
||||
var previousConfig = this.currentConfig;
|
||||
if (!markerName) {
|
||||
this.currentMarker = null;
|
||||
this.currentConfig = this.config;
|
||||
|
@ -221,7 +222,9 @@ var BaseSound = new Class({
|
|||
this.currentConfig = this.currentMarker.config;
|
||||
this.duration = this.currentMarker.duration;
|
||||
}
|
||||
this.resetConfig();
|
||||
if (previousConfig !== this.currentConfig) {
|
||||
this.resetConfig();
|
||||
}
|
||||
this.currentConfig = Extend(this.currentConfig, config);
|
||||
this.isPlaying = true;
|
||||
this.isPaused = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue