Skip to content

Class: VideoComponent ​

Video playback on a textured quad. Draw-side fields mirror SpriteComponent (it IS a sprite as far as the scene graph is concerned — transforms, z-order, masks and opacity all apply); transport mirrors AudioComponent.

Sizing reuses SpriteSizeMode rather than declaring a parallel enum: Raw adopts the video's natural dimensions once metadata lands, Custom tracks the host UITransform.

muted defaults to TRUE. That isn't a taste call — browsers refuse to autoplay audible video without a prior user gesture, so an unmuted default would make playOnAwake silently fail on mobile. Unmute after a tap if you need sound.

Extends ​

Constructors ​

Constructor ​

ts
new VideoComponent(
   assetId?, 
   loop?, 
   playOnAwake?, 
   muted?, 
   volume?, 
   sizeMode?
): VideoComponent;

Parameters ​

ParameterTypeDefault value
assetIdstring | VideoClip""
loopbooleanfalse
playOnAwakebooleanfalse
mutedbooleantrue
volumenumber1
sizeModeSpriteSizeModeSpriteSizeMode.Raw

Returns ​

VideoComponent

Overrides ​

Component.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited from
assetIdpublicstringundefined--
dirtypublicbooleantrue-Component.dirty
enabledpublicbooleantrue-Component.enabled
looppublicbooleanundefined--
materialpublicstringundefinedMaterial slot (MaterialFields.ts).-
materialValuespublicRecord<string, unknown>undefined--
mutedpublicbooleanundefined--
playOnAwakepublicbooleanundefined--
sizeModepublicSpriteSizeModeundefined--
tintpublicnumberundefined--
volumepublicnumberundefined--

Accessors ​

videoClip ​

Get Signature ​

ts
get videoClip(): VideoClip;
Returns ​

VideoClip

Set Signature ​

ts
set videoClip(clip): void;
Parameters ​
ParameterType
clipVideoClip
Returns ​

void

Methods ​

ApplyVolume() ​

ts
ApplyVolume(): void;

Push volume/muted to the live element without restarting. The render system diffs these every frame anyway; this is for callers who want the change to land immediately.

Returns ​

void


GetDuration() ​

ts
GetDuration(): number;

0 until metadata has loaded, and for streams with no fixed length.

Returns ​

number


GetTime() ​

ts
GetTime(): number;

Returns ​

number


IsPlaying() ​

ts
IsPlaying(): boolean;

Returns ​

boolean


IsReady() ​

ts
IsReady(): boolean;

Returns ​

boolean


Pause() ​

ts
Pause(): void;

Returns ​

void


Play() ​

ts
Play(): void;

Returns ​

void


Seek() ​

ts
Seek(seconds): void;

No-op before the clip is seekable; the browser rejects a seek past metadata.

Parameters ​

ParameterType
secondsnumber

Returns ​

void


Stop() ​

ts
Stop(): void;

Pauses and rewinds to the start, unlike Pause().

Returns ​

void

© 2026 PlayAdGentic