Skip to content

Commit f0b7670

Browse files
committed
Fixed an issue where audio files with query strings after them would fail the canPlayAudio checks (thanks Vithar)
1 parent 1377b94 commit f0b7670

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Version 2.1.3 - "Ravinda" - in development
100100

101101
* Fixed a reference error to the Loader.baseURL in Cache._resolveUrl method (thanks @neurofuzzy #1235)
102102
* Fixed the Filter mouse uniform value population.
103+
* Fixed an issue where audio files with query strings after them would fail the `canPlayAudio` checks (thanks Vithar)
103104

104105
For details about changes made in previous versions of Phaser see the full Change Log at https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md
105106

src/loader/Loader.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,11 +1391,15 @@ Phaser.Loader.prototype = {
13911391
extension = urls[i].toLowerCase();
13921392
extension = extension.substr((Math.max(0, extension.lastIndexOf(".")) || Infinity) + 1);
13931393

1394+
if (extension.indexOf("?") >= 0)
1395+
{
1396+
extension = extension.substr(0, extension.indexOf("?"));
1397+
}
1398+
13941399
if (this.game.device.canPlayAudio(extension))
13951400
{
13961401
return urls[i];
13971402
}
1398-
13991403
}
14001404

14011405
return null;

0 commit comments

Comments
 (0)