Skip to content

Commit

Permalink
Handle promise rejection for sound.play() in preload
Browse files Browse the repository at this point in the history
  • Loading branch information
epicfaace committed Dec 10, 2018
1 parent c9411df commit 3332f06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/workspace_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Blockly.WorkspaceAudio.prototype.preload = function() {
for (var name in this.SOUNDS_) {
var sound = this.SOUNDS_[name];
sound.volume = 0.01;
sound.play();
sound.play().catch(function() {});
sound.pause();
// iOS can only process one sound at a time. Trying to load more than one
// corrupts the earlier ones. Just load one and leave the others uncached.
Expand Down

0 comments on commit 3332f06

Please sign in to comment.