VideoTexture Class

Extends Texture
Module: Textures

Video texture, uses a video DOM element instead of a img element.

VideoTexture also provides methods for playback control.

Constructor

VideoTexture

(
  • video
  • mapping
  • wrapS
  • wrapT
  • type
  • anisotropy
)

Parameters:

  • video Video
  • mapping Number
  • wrapS Number
  • wrapT Number
  • type Number
  • anisotropy Number

Methods

dispose

()

Dispose video texture.

Stops the video and cleans the DOM video element inside the VideoTexture.

pause

()

Pause video playback.

play

()

Start playing video.

setAutoPlay

(
  • value
)

Set autoplay value.

If the image is already playing it will not stop playing.

Parameters:

  • value Boolean

    If true the video will play automatically.

setLoop

(
  • loop
)

Set loop mode.

Parameters:

  • loop Boolean

setPlaybackRate

(
  • playbackRate
)

Set video playback speed.

Parameters:

  • playbackRate Number

setTime

(
  • time
)

Set video time in seconds.

Parameters:

  • time Number

setVolume

(
  • volume
)

Set video volume.

Parameters:

  • volume Number

toJSON

(
  • meta
)
Object

Create Video texture json description.

Parameters:

  • meta Object

Returns:

Object:

json

Properties

autoplay

Boolean

If true the video starts playing automatically.

Default: true

image

DOM

Image is used to store a DOM video element.

loop

Boolean

If true the video plays in loop.

Default: true

playbackRate

Number

Start time in seconds.

Default: 1.0

volume

Number

Video audio volume, its a values between 1.0 and 0.0

Default: 1.0