Skip to content

Commit 106e324

Browse files
Sorting sounds to hijack audio from by loop and seek properties values
1 parent f377b4f commit 106e324

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ var HTML5AudioSound = new Class({
8383
otherSounds_1.push(sound);
8484
}
8585
});
86+
otherSounds_1.sort(function (a1, a2) {
87+
if (a1.loop === a2.loop) {
88+
return a2.seek - a1.seek;
89+
}
90+
return a1.loop ? 1 : -1;
91+
});
8692
var selectedSound = otherSounds_1[0];
8793
this.audio = selectedSound.audio;
8894
}

0 commit comments

Comments
 (0)