mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Sorting sounds to hijack audio from by loop and seek properties values
This commit is contained in:
parent
f377b4fa85
commit
106e32499f
1 changed files with 6 additions and 0 deletions
|
@ -83,6 +83,12 @@ var HTML5AudioSound = new Class({
|
|||
otherSounds_1.push(sound);
|
||||
}
|
||||
});
|
||||
otherSounds_1.sort(function (a1, a2) {
|
||||
if (a1.loop === a2.loop) {
|
||||
return a2.seek - a1.seek;
|
||||
}
|
||||
return a1.loop ? 1 : -1;
|
||||
});
|
||||
var selectedSound = otherSounds_1[0];
|
||||
this.audio = selectedSound.audio;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue