Class: VideoSource

VideoSource

A source for video-based textures.

Members

MIME_TYPES Dict<string> staticreadonly

Map of video MIME types that can't be directly derived from file extensions.

autoUpdate boolean

Should the base texture automatically update itself, set to true by default.

isValid boolean

Checks if the resource has valid dimensions.

updateFPS number

How many times a second to update the texture from the video. Leave at 0 to update at every render. A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient.

autoPlay boolean protected

When set to true will automatically play videos used by this texture once they are loaded. If false, it will not modify the playing state.

Default Value:
  • true

Methods

destroy ()

Cleans up resources and event listeners associated with this texture.

load () Promise<this>

Start preloading the video resource.

Returns:
Type Description
Promise<this> Handle the validate event

updateFrame () void protected

Update the video frame if the source is not destroyed and meets certain conditions.