mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 14:40:38 +00:00
Setting audio to correct state when starting it since it might be playing already when hijacked form another sound
This commit is contained in:
parent
e68ff2b18a
commit
81d794b4c6
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue