Wrapped the decodeAudio in a try/catch.

This commit is contained in:
photonstorm 2015-05-14 23:21:19 +01:00
parent b91387c9a6
commit 4cd374691a

View file

@ -395,16 +395,19 @@ Phaser.SoundManager.prototype = {
{
this.game.cache.updateSound(key, 'isDecoding', true);
var that = this;
var _this = this;
this.context.decodeAudioData(soundData, function (buffer) {
try {
this.context.decodeAudioData(soundData, function (buffer) {
if (buffer)
{
that.game.cache.decodedSound(key, buffer);
that.onSoundDecode.dispatch(key, sound);
}
});
if (buffer)
{
_this.game.cache.decodedSound(key, buffer);
_this.onSoundDecode.dispatch(key, sound);
}
});
}
catch (e) {}
}
}