From b9911332c7aac8d4154b0ea8a1beca2ab97170f7 Mon Sep 17 00:00:00 2001 From: "Michael \"Z\" Goddard" Date: Tue, 10 Apr 2018 13:36:39 -0400 Subject: [PATCH] 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. --- src/sprites/rendered-target.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/sprites/rendered-target.js b/src/sprites/rendered-target.js index aba3aef64..fcd57ca53 100644 --- a/src/sprites/rendered-target.js +++ b/src/sprites/rendered-target.js @@ -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' }; }