The VideoRenderer component plays and renders a video element, and allows configuring options such as its dimensions, coloring, etc.

videoRenderer.video = this.assetManager.getVideo("video.mp4");
videoRenderer.width = 1920;
videoRenderer.height = 1080;
videoRenderer.offset = new Vector2(0, 0);
videoRenderer.flipHorizontally = false;
videoRenderer.flipVertically = false;
videoRenderer.rotation = 0;
videoRenderer.opacity = 1;
videoRenderer.maskColor = "#FF0000";
videoRenderer.maskColorMix = 0;
videoRenderer.tintColor = "#00FF00";
videoRenderer.layer = "Default";
videoRenderer.slice = {x: 0, y:0, width: 1920, height: 1080};
videoRenderer.volume = 1;
videoRenderer.loop = false;
videoRenderer.play = true;
videoRenderer.pause = false;

Constructors

Properties

flipHorizontally: boolean

Flip the video horizontally

flipVertically: boolean

Flip the video vertically

height: number

Overwrite the original video height

layer: string = defaultRenderLayer

The render layer

loop: boolean = false

TRUE to play the video in loop

maskColor: string

Define a mask color for the video

maskColorMix: number

Define the opacity of the mask color between 1 and 0

offset: Vector2 = ...

X-axis and Y-axis offset

opacity: number

Change the opacity between 1 and 0

pause: boolean = false

TRUE to pause the video

play: boolean = false

TRUE to play the video. If the video stops playing it becomes FALSE

rotation: number = 0

Video rotation (degrees or radians)

slice?: Slice

Cut the video based on straight coordinates starting from the top left downward

tintColor: string

Define a color for tinting the video

video: HTMLVideoElement

The video element to render

volume: number = 1

The volume of the video (between 1 and 0)

width: number

Overwrite the original video width