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
| Parameter | Type | Default value |
|---|---|---|
assetId | string | VideoClip | "" |
loop | boolean | false |
playOnAwake | boolean | false |
muted | boolean | true |
volume | number | 1 |
sizeMode | SpriteSizeMode | SpriteSizeMode.Raw |
Returns
VideoComponent
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Inherited from |
|---|---|---|---|---|---|
assetId | public | string | undefined | - | - |
dirty | public | boolean | true | - | Component.dirty |
enabled | public | boolean | true | - | Component.enabled |
loop | public | boolean | undefined | - | - |
material | public | string | undefined | Material slot (MaterialFields.ts). | - |
materialValues | public | Record<string, unknown> | undefined | - | - |
muted | public | boolean | undefined | - | - |
playOnAwake | public | boolean | undefined | - | - |
sizeMode | public | SpriteSizeMode | undefined | - | - |
tint | public | number | undefined | - | - |
volume | public | number | undefined | - | - |
Accessors
videoClip
Get Signature
ts
get videoClip(): VideoClip;Returns
Set Signature
ts
set videoClip(clip): void;Parameters
| Parameter | Type |
|---|---|
clip | VideoClip |
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
| Parameter | Type |
|---|---|
seconds | number |
Returns
void
Stop()
ts
Stop(): void;Pauses and rewinds to the start, unlike Pause().
Returns
void