mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 09:48:18 +00:00
Use cache reference, more concise error
This commit is contained in:
parent
5456267b2a
commit
a51267419d
1 changed files with 4 additions and 2 deletions
|
@ -44,11 +44,11 @@ var HTML5AudioSound = new Class({
|
||||||
* @private
|
* @private
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
this.tags = manager.game.cache.audio.get(key);
|
this.tags = manager.cache.get(key);
|
||||||
|
|
||||||
if (!this.tags)
|
if (!this.tags)
|
||||||
{
|
{
|
||||||
throw new Error('There is no audio asset with key "' + key + '" in the audio cache');
|
throw new Error('Audio cache missing "' + key + '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,6 +92,8 @@ var HTML5AudioSound = new Class({
|
||||||
this.totalDuration = this.tags[0].duration;
|
this.totalDuration = this.tags[0].duration;
|
||||||
|
|
||||||
BaseSound.call(this, manager, key, config);
|
BaseSound.call(this, manager, key, config);
|
||||||
|
|
||||||
|
console.log('HTML5AudioSound created', this.tags);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue