Skip to content

Commit c60f91d

Browse files
McSamMcSam
authored andcommitted
The play() request was interrupted by a call to pause().
1 parent 7468398 commit c60f91d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/botPage/view/blockly/customBlockly.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,21 @@ Blockly.Toolbox.TreeNode.prototype.onClick_ = function(_e) {
358358
}
359359
this.updateRow();
360360
};
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

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy