Class: VideoSource

VideoSource

A source for video-based textures.

Members

defaultOptions VideoSourceOptions static

The default options for video sources.

Properties:
Name Type Default Description
autoLoad boolean true

If true, the video will start loading immediately.

autoPlay boolean true

If true, the video will start playing as soon as it is loaded.

crossorigin boolean true

If true, the video will be loaded with the crossorigin attribute.

loop boolean false

If true, the video will loop when it ends.

muted boolean true

If true, the video will be muted.

playsinline boolean true

If true, the video will play inline.

preload boolean false

If true, the video will be preloaded.

updateFPS number 0

The number of times a second to update the texture from the video. Leave at 0 to update at every render.

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.

isReady boolean

Whether or not the video is ready to play.

Default Value:
  • false

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.

uploadMethodId string

The upload method for this texture.

Default Value:
  • "video"

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.