mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
stopAllSounds (args, util) {
|
stopAllSounds () {
|
||||||
if (util.target.audioPlayer === null) return;
|
if (this.runtime.targets === null) return;
|
||||||
util.target.audioPlayer.stopAllSounds();
|
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) {
|
setEffect (args, util) {
|
||||||
|
|
Loading…
Reference in a new issue