mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Finding another sound to hijack audio tag from if there are no free audio tags and override setting is set to true
This commit is contained in:
parent
fc19a05f0b
commit
f377b4fa85
1 changed files with 8 additions and 0 deletions
|
@ -77,6 +77,14 @@ var HTML5AudioSound = new Class({
|
|||
if (!this.manager.override) {
|
||||
return false;
|
||||
}
|
||||
var otherSounds_1 = [];
|
||||
this.manager.forEachActiveSound(function (sound) {
|
||||
if (sound.key === this.key && sound.isPlaying) {
|
||||
otherSounds_1.push(sound);
|
||||
}
|
||||
});
|
||||
var selectedSound = otherSounds_1[0];
|
||||
this.audio = selectedSound.audio;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue