mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Stop all sounds for all targets
This commit is contained in:
parent
967169c714
commit
a6d17fcba3
1 changed files with 11 additions and 3 deletions
|
@ -167,9 +167,17 @@ class Scratch3SoundBlocks {
|
|||
return -1;
|
||||
}
|
||||
|
||||
stopAllSounds (args, util) {
|
||||
if (util.target.audioPlayer === null) return;
|
||||
util.target.audioPlayer.stopAllSounds();
|
||||
stopAllSounds () {
|
||||
if (this.runtime.targets === null) return;
|
||||
const allTargets = this.runtime.targets;
|
||||
for (let i = 0; i < allTargets.length; i++) {
|
||||
this._stopAllSoundsForTarget(allTargets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
_stopAllSoundsForTarget (target) {
|
||||
if (target.audioPlayer === null) return;
|
||||
target.audioPlayer.stopAllSounds();
|
||||
}
|
||||
|
||||
setEffect (args, util) {
|
||||
|
|
Loading…
Reference in a new issue