mirror of
https://github.com/sbrl/soundbox.git
synced 2018-01-10 21:33:43 +00:00
Fix Promise
This commit is contained in:
parent
f2af3336c1
commit
35b62d4506
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ function SoundBox() {
|
|||
if(typeof callback == "function")
|
||||
this.sounds[sound_name].addEventListener("canplaythrough", callback);
|
||||
else
|
||||
return new Promise((resolve, reject) => this.sounds[sound_name].addEventListener("canplaythrough", resolve));
|
||||
return new Promise((resolve, reject) => this.sounds[sound_name].addEventListener("canplaythrough", resolve), this.sounds[sound_name].addEventListener("error", reject));
|
||||
};
|
||||
|
||||
this.remove = function(sound_name) {
|
||||
|
|
Loading…
Reference in a new issue