Resolves
Fixes #1635, fixes #1062, partially #1715 with a test for whether the videoSensing
extension loads
Proposed Changes
This PR does a few things:
- Checks the stage target after the project has loaded and sets the project's videoOn
and videoTransparency
accordingly.
- Makes the check for this._drawable
more specific in video.js
. Since its default value is -1
, it evaluated to truthy even when it shouldn't have. This was causing some issues when I was writing a test for the video state since (!this._drawable)
evaluated to true and the video device thought a renderer should be present.
- Arranges the load-extensions
test project files in subdirectories now that we have multiple tests in load-extensions.js
Reason for Changes
Previously the check for the stage's video properties was done before targets were installed, so the stage target's info wasn't available. Now with the PROJECT_LOADED
event, we can wait until later to check the stage and get the info we need to correctly set the project's video values.
Test Coverage
I've added some tests for whether the video is on and the video's transparency in load-extensions.js
. There doesn't appear to be a flag or property indicating the video io device has been turned on in the same way that _ghost
stores the transparency value, so I used the definition of the mirror
property as a proxy for that information. Let me know if I should check whether the video is on another way though!
该提问来源于开源项目:LLK/scratch-vm