Skip to content

Commit 3388fd0

Browse files
Setting startTime based on delay config when calling play method
1 parent d6256c4 commit 3388fd0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ var HTML5AudioSound = new Class({
5454
this.audio.currentTime = offset;
5555
this.applyConfig();
5656
if (delay === 0) {
57+
this.startTime = 0;
5758
this.audio.play();
5859
}
60+
else {
61+
this.startTime = window.performance.now() + delay;
62+
}
5963
this.resetConfig();
6064
this.events.dispatch(new SoundEvent(this, 'SOUND_PLAY'));
6165
return true;

0 commit comments

Comments
 (0)