Skip to content

Commit 82819ec

Browse files
Setting sound position, applying config and starting playback if delay is set to 0 when calling play method
1 parent 1192362 commit 82819ec

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ var HTML5AudioSound = new Class({
3838
this.reset();
3939
return false;
4040
}
41+
var seek = this.currentConfig.seek;
42+
var delay = this.currentConfig.delay;
43+
var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek;
44+
this.audio.currentTime = offset;
45+
this.applyConfig();
46+
if (delay === 0) {
47+
this.audio.play();
48+
}
49+
this.resetConfig();
4150
this.events.dispatch(new SoundEvent(this, 'SOUND_PLAY'));
4251
return true;
4352
},

0 commit comments

Comments
 (0)