Vithar Posted October 17, 2014 Share Posted October 17, 2014 I found a bug with loading audio files, and I am not a github member, so I couldn't report it there. If you add a query parameter after the audio URL, it is not removed from the extension variable, and will cause the canPlayAudio(extension) check to fail. Example url = 'Audio/mySong.mp3?v=1' extension will be: 'mp3?v=1' but should be just 'mp3'getAudioURL: function (urls) { var extension; if (typeof urls === 'string') { urls = [urls]; } for (var i = 0; i < urls.length; i++) { extension = urls[i].toLowerCase(); extension = extension.substr((Math.max(0, extension.lastIndexOf(".")) || Infinity) + 1); if (this.game.device.canPlayAudio(extension)) { return urls[i]; } } return null; }to fix this, I added a quick check, but there might be a more optimized way of doing this.if(extension.indexOf("?") >= 0){ extension = extension.substr(0, extension.indexOf("?"));} Link to comment Share on other sites More sharing options...
rich Posted October 17, 2014 Share Posted October 17, 2014 https://github.com/photonstorm/phaser/commit/f0b767050660800904565cc7490e140c8e262e69 PS - You should totally register on github Link to comment Share on other sites More sharing options...
Recommended Posts