mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-11 21:11:10 -04:00
fix:avoid unexpected value of videoState
This commit is contained in:
parent
5cf2de9eef
commit
f30e1e3418
1 changed files with 1 additions and 1 deletions
|
@ -566,7 +566,7 @@ class Scratch3VideoSensingBlocks {
|
|||
* @param {VideoState} args.VIDEO_STATE - the video state to set the device to
|
||||
*/
|
||||
videoToggle (args) {
|
||||
const state = args.VIDEO_STATE;
|
||||
const state = Object.values(VideoState).includes(args.VIDEO_STATE) ? args.VIDEO_STATE : VideoState.OFF;
|
||||
this.globalVideoState = state;
|
||||
if (state === VideoState.OFF) {
|
||||
this.runtime.ioDevices.video.disableVideo();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue