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.

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

setVideo

(
  • video
)

Set the video source to be used.

Can be a Video, VideoStream or a URL String.

Parameters:

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

Element

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

video

Video

Video source resource.

volume

Number

Video audio volume, its a values between 1.0 and 0.0.

Default: 1.0