better handling for sounds that did not load

This commit is contained in:
Eric Rosenbaum 2016-10-25 16:43:03 -04:00
parent cfabc507ae
commit b30996997a

View file

@ -71,10 +71,12 @@ AudioEngine.prototype.playSound = function (index) {
} else {
// if the sound has not yet loaded, wait and try again
log.warn('sound ' + index + ' not loaded yet');
if (player) {
setTimeout(function () {
this.playSound(index);
}.bind(this), 500);
}
}
};
AudioEngine.prototype.getSoundDuration = function (index) {