mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Default stage.videoState to ON
Set to ON, adding a video extension when a user selects a video extension in the gui, the video extension will use stage.videoState to turn on the video device. Adding a video extension as part of loading a project, the stage's videoState will be set to the stored value in the project's saved data, and the extension will set the video device's state with that saved value.
This commit is contained in:
parent
044370790c
commit
b9911332c7
1 changed files with 13 additions and 5 deletions
|
@ -140,9 +140,17 @@ class RenderedTarget extends Target {
|
|||
/**
|
||||
* The state of the video input (used by extensions with camera input).
|
||||
* This property is global to the project and stored in the stage.
|
||||
*
|
||||
* Defaults to ON. This setting does not turn the video by itself. A
|
||||
* video extension once loaded will set the video device to this
|
||||
* setting. Set to ON when a video extension is added in the editor the
|
||||
* video will start ON. If the extension is loaded as part of loading a
|
||||
* saved project the extension will see the value set when the stage
|
||||
* was loaded from the saved values including the video state.
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
this.videoState = RenderedTarget.VIDEO_STATE.OFF;
|
||||
this.videoState = RenderedTarget.VIDEO_STATE.ON;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -211,13 +219,13 @@ class RenderedTarget extends Target {
|
|||
|
||||
/**
|
||||
* Available states for video input.
|
||||
* @type {object}
|
||||
* @enum {string}
|
||||
*/
|
||||
static get VIDEO_STATE () {
|
||||
return {
|
||||
'OFF': 'off',
|
||||
'ON': 'on',
|
||||
'ON-FLIPPED': 'on-flipped'
|
||||
OFF: 'off',
|
||||
ON: 'on',
|
||||
ON_FLIPPED: 'on-flipped'
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue