Skip to content

Commit

Permalink
Fixed an issue where audio files with query strings after them would …
Browse files Browse the repository at this point in the history
…fail the `canPlayAudio` checks (thanks Vithar)
  • Loading branch information
photonstorm committed Oct 17, 2014
1 parent 1377b94 commit f0b7670
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -100,6 +100,7 @@ Version 2.1.3 - "Ravinda" - in development

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

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

Expand Down
6 changes: 5 additions & 1 deletion src/loader/Loader.js
Expand Up @@ -1391,11 +1391,15 @@ Phaser.Loader.prototype = {
extension = urls[i].toLowerCase();
extension = extension.substr((Math.max(0, extension.lastIndexOf(".")) || Infinity) + 1);

if (extension.indexOf("?") >= 0)
{
extension = extension.substr(0, extension.indexOf("?"));
}

if (this.game.device.canPlayAudio(extension))
{
return urls[i];
}

}

return null;
Expand Down

0 comments on commit f0b7670

Please sign in to comment.