A video file playback Drawable. Due to platform specifics, each target have their own limitations.
Hashlink: Playback ability depends on `https://github.com/HeapsIO/hlvideo` library. It support only video with the AV1 codec packed into a WEBM container.JavaScript: HTML Video element will be used. Playback is restricted by content-security policy and browser decoder capabilities.Constructor
new(?parent:Object)
Create a new Video instance.
Parameters:
parent | An optional parent |
---|---|
cacheSize | Hashlink: async precomputing up to `cache` frame. If 0, synchronized computing |
Variables
Methods
loadFile(path:String, ?onReady:() ‑> Void):Void
Loads and starts the video playback by specified path
and calls onReady
when playback becomes possible.
@param path The video path. Have to be valid file-system path for HL or valid URL (full or relative) for JS.
@param onReady An optional callback signalling that video is initialized and began the video playback.
loadResource(res:Resource, ?onReady:() ‑> Void):Void
Loads and starts the video playback by specified res
and calls onReady
when playback becomes possible.
@param res The heaps resource of a valid video file
@param onReady An optional callback signalling that video is initialized and began the video playback.
dynamiconError(msg:String):Void
Sent when there is an error with the decoding or playback of the video.