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:
Pavle Goloskokovic 2018-01-11 18:11:10 +01:00
parent fc19a05f0b
commit f377b4fa85

View file

@ -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;
},