We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7468398 commit c60f91dCopy full SHA for c60f91d
src/botPage/view/blockly/customBlockly.js
@@ -358,3 +358,21 @@ Blockly.Toolbox.TreeNode.prototype.onClick_ = function(_e) {
358
}
359
this.updateRow();
360
};
361
+
362
+/**
363
+ * Preload all the audio files so that they play quickly when asked for.
364
+ * @package
365
+ */
366
+Blockly.WorkspaceAudio.prototype.preload = function() {
367
+ for (var name in this.SOUNDS_) {
368
+ var sound = this.SOUNDS_[name];
369
+ sound.volume = 0.01;
370
+ sound.play().catch(function() {});
371
+ sound.pause();
372
+ // iOS can only process one sound at a time. Trying to load more than one
373
+ // corrupts the earlier ones. Just load one and leave the others uncached.
374
+ if (goog.userAgent.IPAD || goog.userAgent.IPHONE) {
375
+ break;
376
+ }
377
378
+};
0 commit comments