This PR adds a new video part and view to the env. In addition, there is some minor cleanup to the audio part, fixing up of tests and so on.
The new video part is in spirit similar to the audio (and image) parts but has a few specific features.
Commands:
loadFromSource: load a video from a URL (in the halo)
loadFromFile: load video via local file browser (in the halo)
play
pause: toggles the play prop to false
stop: resets the video to time 0
mute/unmute
Additional properties (not controlled with commands):
loop
autoplay
controls: opens up the html video element controls
Things to note:
Since it's natural for people to see controls overlay the video, like here
we needed to make sure that control the part via the native DOM controls and the ST commands was 1-1. The event listeners set after the video element is connected account for this.
In addition, I had to be careful to make sure that the video plays in the navigator just like it does in the main view:
but that it does so without sound (otherwise you get 2 or 3x the sound track in parallel which is fun...) For this reason, the lensed (nav) elements are always muted and you cannot unmute them.
Tests
I have written video tests and fixed a few older failing ones, due to lack of care to select prop view (not nav) elements for testings.
TODO
We should probably make a general html media part from which to subclass image, audio and video. Issue #135
Main Points
This PR adds a new
video
part and view to the env. In addition, there is some minor cleanup to the audio part, fixing up of tests and so on.The new video part is in spirit similar to the audio (and image) parts but has a few specific features.
Commands:
loadFromSource
: load a video from a URL (in the halo)loadFromFile
: load video via local file browser (in the halo)play
pause
: toggles theplay
prop to falsestop
: resets the video to time 0mute/unmute
Additional properties (not controlled with commands):
loop
autoplay
controls
: opens up the html video element controlsThings to note: Since it's natural for people to see controls overlay the video, like here
we needed to make sure that control the part via the native DOM controls and the ST commands was 1-1. The event listeners set after the video element is connected account for this.
In addition, I had to be careful to make sure that the video plays in the navigator just like it does in the main view:
but that it does so without sound (otherwise you get 2 or 3x the sound track in parallel which is fun...) For this reason, the lensed (nav) elements are always muted and you cannot unmute them.
Tests
I have written video tests and fixed a few older failing ones, due to lack of care to select prop view (not nav) elements for testings.
TODO
We should probably make a general html media part from which to subclass image, audio and video. Issue #135