mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Handle promise rejection for sound.play() in preload (#2162)
This commit is contained in:
committed by
RoboErikG
parent
c9411dfa33
commit
8422f931f1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user