Setting startTime based on delay config when calling play method

This commit is contained in:
Pavle Goloskokovic 2018-01-11 18:30:16 +01:00
parent d6256c47c5
commit 3388fd018f

View file

@ -54,8 +54,12 @@ var HTML5AudioSound = new Class({
this.audio.currentTime = offset;
this.applyConfig();
if (delay === 0) {
this.startTime = 0;
this.audio.play();
}
else {
this.startTime = window.performance.now() + delay;
}
this.resetConfig();
this.events.dispatch(new SoundEvent(this, 'SOUND_PLAY'));
return true;