mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
Wrapped the decodeAudio in a try/catch.
This commit is contained in:
parent
b91387c9a6
commit
4cd374691a
1 changed files with 11 additions and 8 deletions
|
@ -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) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue