Skip to content

Commit 1973781

Browse files
Resetting config when calling play method only if current call plays different marker than previous (to enable setting seek before replaying same sound)
1 parent 75d480f commit 1973781

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

v3/src/sound/BaseSound.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ var BaseSound = new Class({
207207
console.error('Sound marker name has to be a string!');
208208
return null;
209209
}
210+
var previousConfig = this.currentConfig;
210211
if (!markerName) {
211212
this.currentMarker = null;
212213
this.currentConfig = this.config;
@@ -221,7 +222,9 @@ var BaseSound = new Class({
221222
this.currentConfig = this.currentMarker.config;
222223
this.duration = this.currentMarker.duration;
223224
}
224-
this.resetConfig();
225+
if (previousConfig !== this.currentConfig) {
226+
this.resetConfig();
227+
}
225228
this.currentConfig = Extend(this.currentConfig, config);
226229
this.isPlaying = true;
227230
this.isPaused = false;

0 commit comments

Comments
 (0)