Skip to content

Commit f377b4f

Browse files
Finding another sound to hijack audio tag from if there are no free audio tags and override setting is set to true
1 parent fc19a05 commit f377b4f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ var HTML5AudioSound = new Class({
7777
if (!this.manager.override) {
7878
return false;
7979
}
80+
var otherSounds_1 = [];
81+
this.manager.forEachActiveSound(function (sound) {
82+
if (sound.key === this.key && sound.isPlaying) {
83+
otherSounds_1.push(sound);
84+
}
85+
});
86+
var selectedSound = otherSounds_1[0];
87+
this.audio = selectedSound.audio;
8088
}
8189
return true;
8290
},

0 commit comments

Comments
 (0)