Stop hiding a failure state, fixes a race

master
William Toohey 9 years ago
parent b9a808e1a3
commit 8a94978bb9
  1. 11
      src/js/SoundManager.js

@ -170,7 +170,7 @@ SoundManager.prototype.playSong = function(song, playBuild, forcePlay) {
}).then(buffers => { }).then(buffers => {
// To prevent race condition if you press "next" twice fast // To prevent race condition if you press "next" twice fast
if(song != this.song) { if(song != this.song) {
// Stop processing - silently ignored in the catch below // Stop processing
throw { throw {
name: "SoundManagerRace", name: "SoundManagerRace",
message: "Song not playable - ignoring!" message: "Song not playable - ignoring!"
@ -194,15 +194,6 @@ SoundManager.prototype.playSong = function(song, playBuild, forcePlay) {
return this.context.resume(); return this.context.resume();
}).then(() => { }).then(() => {
this.playing = true; this.playing = true;
}).catch(error => {
if(error.name == "SoundManagerRace") {
// Just to ignore it if the song was invalid
// Log it in case it's something weird
console.log("SoundManager couldn't play song", error);
return;
} else {
throw error;
}
}); });
return p; return p;
}; };

Loading…
Cancel
Save