Video
This extension allows you to load and display videos onto sprites.
Unlike costumes, videos are temporary. As in, they are not loaded when the project is opened. Instead, videos are loaded with blocks as the project is running.
Video Management
Videos can be imported using this block.
The URL input must point directly to the video file (for example, a URL ending in .mp4, .webm, or another supported video format). Data.URIs are supported.
The extension supports any video format that your browser's standard <video> element can play.
You must also provide a name for the video. This name is used by other blocks to identify and reference the imported video.
Importing a video with the same name as another will overwrite the data of that video. Any sprite that was using this video will now show the new one.
This block will delete the referenced video.
After a video is deleted, it can no longer be referenced by other blocks. Any sprites currently displaying the deleted video will stop using it.
This reporter will output an array of the names of all imported videos.
Displays the specified video on the selected sprite.
If the sprite is already showing a video, it will be replaced with the new one.
Stops displaying a video on the selected sprite and switches back to its original image.
This only removes the video from the sprite. The video remains loaded in the extension and can be shown again later.
Reports the name of the video currently being displayed on the selected sprite.
If no video is displayed, this block will return an empty value.
Video Playback
Starts playing the specified video from the given time, in seconds.
If the video is already playing, playback restarts from the specified position.
Starts playing the specified video from the given time, in seconds, and waits until playback finishes.
If the video is already playing, playback restarts from the specified position before waiting for it to finish.
Reports the selected property of the specified video.
Available properties:
- current time: Current playback position, in seconds
- duration: Total length of the video, in seconds
- volume: Current volume, from 0 to 100
- width: Native width, in pixels
- height: Native height, in pixels
- playback rate: Current playback speed (1 is normal speed)
Reports a Data.URI containing an image of the video's current frame.
The returned value can be used anywhere a URL/Data.URI image is accepted, such as the Skins extension.
Pauses playback of the specified video.
Resumes playback of the specified video. If the video is already playing, this block has no effect.
Toggles wether the specified video should loop or not.
Reports the selected property of the specified video.
Available properties:
- playing: True if the video is actively playing
- paused: True if the video is paused
- looping: True if the video will loop
Sets the volume of the specified video.
The volume value ranges from 0 (muted) to 100 (maximum volume).
Changes the playback speed of the specified video.
A value of 1 is the normal playback speed. Values above 1 make the video play faster, while values below 1 make it play slower.
Values less than 0 will do nothing.