Texture

VideoTexture

Creates a texture for use with a video.

After the initial use of a texture, the video cannot be changed. Instead, call .dispose() on the texture and instantiate a new one.

Code Example

// assuming you have created a HTML video element with id="video" const video = document.getElementById('video'); const texture = new v3d.VideoTexture(video);

Constructor

VideoTexture(video : HTMLVideoElement, mapping : Constant, wrapS : Constant, wrapT : Constant, magFilter : Constant, minFilter : Constant, format : Constant, type : Constant, anisotropy : Integer)

Properties

See the base Texture class for common properties.

.generateMipmaps : Boolean

Whether to generate mipmaps. false by default.

.isVideoTexture : Boolean

Read-only flag to check if a given object is of type VideoTexture.

.needsUpdate : Boolean

You will not need to set this manually here as it is handled by the update() method.

Methods

See the base Texture class for common methods.

.update()

This is called automatically and sets .needsUpdate to true every time a new frame is available.

Puzzles

Check out the load video and replace texture puzzles to manage video textures in a code-less manner.

Source

For more info on how to obtain the source code of this module see this page.