Interfaces

VideoPlayer

createVideoPlayer's result: a Video the caller drives and owns.

Extends

Properties

currentFrame

readonly currentFrame: ImageLike | null;

The video's frame, null until the first one is decoded. Feed it to <TgfxImage>, or to <CameraFrame> when rotation is not 0.

One object for the life of the video: later frames replace what it points at natively, so this identity is stable and nothing re-commits per frame. It is owned by the player and must not be disposed.

Inherited from

Video.currentFrame


currentTime

readonly currentTime: SharedValueLike<number>;

Playback position in milliseconds, written on the UI thread every frame.

Inherited from

Video.currentTime


duration

readonly duration: number;

Total length in milliseconds. 0 until the video is open.

Inherited from

Video.duration


framerate

readonly framerate: number;

Inherited from

Video.framerate


rotation

readonly rotation: number;

Clockwise degrees the frame must be rotated by to be upright.

Inherited from

Video.rotation


size

readonly size: object;

The decoded frame's size, before rotation is applied.

height

height: number;

width

width: number;

Inherited from

Video.size

Methods

dispose()

dispose(): void;

Stop the pump and release the player and its frame.

Returns

void


onFrame()

onFrame(listener: (frame: ImageLike) => void): void;

Hear about the first decoded frame; fires immediately if it has already landed. One listener - the last registered wins.

Parameters

listener

(frame: ImageLike) => void

Returns

void


setOptions()

setOptions(options: VideoOptions): void;

Change playback options after open. seek seeks again on every call.

Parameters

options

VideoOptions

Returns

void