mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2025-08-20 18:09:21 -04:00
better handling for sounds that did not load
This commit is contained in:
parent
cfabc507ae
commit
b30996997a
1 changed files with 5 additions and 3 deletions
|
@ -71,10 +71,12 @@ AudioEngine.prototype.playSound = function (index) {
|
||||||
} else {
|
} else {
|
||||||
// if the sound has not yet loaded, wait and try again
|
// if the sound has not yet loaded, wait and try again
|
||||||
log.warn('sound ' + index + ' not loaded yet');
|
log.warn('sound ' + index + ' not loaded yet');
|
||||||
|
if (player) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
this.playSound(index);
|
this.playSound(index);
|
||||||
}.bind(this), 500);
|
}.bind(this), 500);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioEngine.prototype.getSoundDuration = function (index) {
|
AudioEngine.prototype.getSoundDuration = function (index) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue