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:
Pavle Goloskokovic 2017-12-07 20:17:00 +01:00
parent 75d480ffba
commit 1973781052

View file

@ -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;