Setting audio to correct state when starting it since it might be playing already when hijacked form another sound

This commit is contained in:
Pavle Goloskokovic 2018-01-12 15:18:31 +01:00
parent e68ff2b18a
commit 81d794b4c6

View file

@ -101,10 +101,15 @@ var HTML5AudioSound = new Class({
this.applyConfig();
if (delay === 0) {
this.startTime = 0;
this.audio.play();
if (this.audio.paused) {
this.audio.play();
}
}
else {
this.startTime = window.performance.now() + delay;
if (!this.audio.paused) {
this.audio.pause();
}
}
this.resetConfig();
return true;