mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
When hijacking audio form other sounds, sorting them by progress rather than just seek, so that we favorize longer sounds to continue their playback
This commit is contained in:
parent
aa820b08ea
commit
44acc440f4
1 changed files with 2 additions and 1 deletions
|
@ -145,7 +145,8 @@ var HTML5AudioSound = new Class({
|
|||
}, this);
|
||||
otherSounds_1.sort(function (a1, a2) {
|
||||
if (a1.loop === a2.loop) {
|
||||
return a2.seek - a1.seek;
|
||||
// sort by progress
|
||||
return (a2.seek / a2.duration) - (a1.seek / a1.duration);
|
||||
}
|
||||
return a1.loop ? 1 : -1;
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue