WebRADDocumentationExplore WebRAD ↗
WEBRAD / TECHNICAL REFERENCE

Video Player

Play RestGO videos and HLS/DASH manifests.

WebVideoPlayerStandardVisual8 events

Quick start

Add VideoPlayer1 in the Designer. Use the example in a page method.

VideoPlayer1 · event
VideoPlayer1.aspectRatio = '16:9';
VideoPlayer1.controls = true;
VideoPlayer1.autoplay = false;
VideoPlayer1.volume = 0.8;
try {
  await VideoPlayer1.LoadRestGo('VIDEO-ID', { public: false });
  await VideoPlayer1.Play();
} catch (error) {
  Message(error instanceof Error ? error.message : String(error));
}
// Alternative: LoadUrl('https://cdn.example.com/master.m3u8', { format: 'hls' }).
  • Configure the source in the Inspector and confirm Apply source, or call LoadRestGo() or LoadUrl().
  • Use Play(), Pause(), Stop(), and Seek(seconds). SetQuality('auto') enables automatic selection; availableQualities lists the options.
  • Configure volume, muted, playbackRate, controls, loop, and aspectRatio for your interface.
  • Private RestGO video uses the current session. Video page URLs do not replace HLS/DASH manifests.
  • Unload() releases the source. OnLoaded, OnPlay, OnPause, OnEnded, and OnError track playback.

More examples

HLS, DASH, quality, and playback control
HLS, DASH, quality, and playback control
await VideoPlayer1.LoadUrl('https://cdn.example.com/manifest.mpd', { format: 'dash' });
VideoPlayer1.muted = true;
VideoPlayer1.loop = false;
VideoPlayer1.playsInline = true;
VideoPlayer1.objectFit = 'contain'; // contain | cover | fill
VideoPlayer1.aspectRatio = '9:16'; // none | 16:9 | 9:16
VideoPlayer1.SetQuality('auto');
const variant = VideoPlayer1.availableQualities[0];
if (variant) VideoPlayer1.SetQuality(variant.quality);
await VideoPlayer1.Play();
VideoPlayer1.Pause();
VideoPlayer1.Seek(10);
VideoPlayer1.Stop();
await VideoPlayer1.Unload();

Inspector properties

Component options and defaults. Fields without runtime access are configured in the Inspector.

Property / sourceType and optionsDefaultRuntime access
nameName · Identitystring—name
xLeft · Size & positionnumber0x
yTop · Size & positionnumber0y
widthWidth · Size & positionnumber480width
heightHeight · Size & positionnumber270height
itemWidthResponsive width · Responsive sizeFit content grows the item to its widest rendered child and preserves child intrinsic widths; minimum and maximum width remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemHeightResponsive height · Responsive sizeFit content grows the item to its lowest rendered child and preserves child intrinsic heights; minimum and maximum height remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemMinWidthMinimum width · Responsive sizenumber0Inspector / configuration
itemMaxWidthMaximum width · Responsive sizenumbernullInspector / configuration
itemMinHeightMinimum height · Responsive sizenumber0Inspector / configuration
itemMaxHeightMaximum height · Responsive sizenumbernullInspector / configuration
itemGrowGrow · Responsive sizenumber0Inspector / configuration
itemShrinkShrink · Responsive sizeAllows fixed and stretch flow items to yield space. Fit-content keeps its intrinsic size so its children are not compressed.booleantrueInspector / configuration
itemAlignSelfItem alignment · Responsive sizeCross-axis alignment for this item in a row or column. Auto inherits the parent alignment; responsive cross-axis stretch retains its sizing behavior.enumauto start center end stretch"auto"Inspector / configuration
itemHorizontalAnchorHorizontal anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemVerticalAnchorVertical anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemLeftLeft inset · Anchors & offsetsnumber0Inspector / configuration
itemRightRight inset · Anchors & offsetsnumber0Inspector / configuration
itemTopTop inset · Anchors & offsetsnumber0Inspector / configuration
itemBottomBottom inset · Anchors & offsetsnumber0Inspector / configuration
marginMargin · SpacingOuter spacing on all four sides, in pixels. Row and column layouts include this spacing between components.number0margin
marginTopMargin top · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginTop
marginRightMargin right · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginRight
marginBottomMargin bottom · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginBottom
marginLeftMargin left · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginLeft
visibleVisible · Behaviorbooleantruevisible
collapseWhenHiddenCollapse when hidden · BehaviorRemoves the component from the layout while it is not visible.booleantruecollapseWhenHidden
enabledEnabled · Behaviorbooleantrueenabled
tabIndexTabIndex · Behaviornumber0tabIndex
aspectRatioAspect ratio · VideoKeep a fixed ratio by calculating height from the responsive width. none uses the saved height rules.enumnone 16:9 9:16"none"aspectRatio
sourceVideo source · Videovideo-sourcenullsource
controlsShow controls · Videobooleantruecontrols
autoplayAutoplay · Videobooleanfalseautoplay
mutedMuted · Videobooleanfalsemuted
loopLoop · Videobooleanfalseloop
playsInlinePlay inline · VideobooleantrueplaysInline
volumeVolume (0–1) · Videonumber1volume
playbackRatePlayback rate · Videonumber1playbackRate
objectFitObject fit · Appearanceenumcontain cover fill none scale-down"contain"objectFit
qualityInitial quality · VideoManual qualities are discovered from the loaded video. Use the playback quality menu or SetQuality().enumauto"auto"quality
posterPoster · AppearanceOptional poster URL. RestGo thumbnails are fetched with the current access policy.string""poster
currentRowBindingsCurrent row · DataBind writable visual values to fields of this repeated row.current-row-bindingsEditor: current-row-bindings[]currentRowBindings

API in code

MemberSignatureAccess
sourceget source(): WebVideoPlayerSource | null;Read and write
controlsget controls(): boolean;Read and write
autoplayget autoplay(): boolean;Read and write
mutedget muted(): boolean;Read and write
loopget loop(): boolean;Read and write
playsInlineget playsInline(): boolean;Read and write
volumeget volume(): number;Read and write
playbackRateget playbackRate(): number;Read and write
objectFitget objectFit(): WebVideoPlayerObjectFit;Read and write
aspectRatioFixed ratios derive height from the responsive width, overriding vertical sizing rules.get aspectRatio(): WebVideoPlayerAspectRatio;Read and write
posterget poster(): string;Read and write
enabledget enabled(): boolean;Read and write
qualityget quality(): WebVideoPlayerQuality;Read and write
stateget state(): WebVideoPlayerState;Read-only
durationget duration(): number;Read-only
currentTimeget currentTime(): number;Read-only
bufferedget buffered(): readonly WebVideoPlayerBufferedRange[];Read-only
availableQualitiesget availableQualities(): readonly WebVideoPlayerAvailableQuality[];Read-only
currentQualityget currentQuality(): number | null;Read-only
isPlayingget isPlaying(): boolean;Read-only
errorget error(): Error | null;Read-only
onLoadedset onLoaded(handler: WebComponentEventHandler<this> | null);Read and write
onPlayset onPlay(handler: WebComponentEventHandler<this> | null);Read and write
onPauseset onPause(handler: WebComponentEventHandler<this> | null);Read and write
onEndedset onEnded(handler: WebComponentEventHandler<this> | null);Read and write
onTimeUpdateset onTimeUpdate(handler: WebComponentEventHandler<this> | null);Read and write
onBufferingset onBuffering(handler: WebComponentEventHandler<this> | null);Read and write
onQualityChangeset onQualityChange(handler: WebComponentEventHandler<this> | null);Read and write
onErrorset onError(handler: WebComponentEventHandler<this> | null);Read and write

LoadRestGo

method
LoadRestGo(videoId: string, options?: WebVideoPlayerRestGoOptions): Promise<void>;
Example
VideoPlayer1.LoadRestGo
await VideoPlayer1.LoadRestGo('VIDEO-ID', { public: false });

LoadUrl

method
LoadUrl(url: string, options?: WebVideoPlayerUrlOptions): Promise<void>;
Example
VideoPlayer1.LoadUrl
await VideoPlayer1.LoadUrl('https://cdn.example.com/master.m3u8', { format: 'hls' });

Play

method
Play(): Promise<void>;
Example
VideoPlayer1.Play
await VideoPlayer1.Play();

Pause

method
Pause(): void;
Example
VideoPlayer1.Pause
VideoPlayer1.Pause();

Stop

method
Stop(): void;
Example
VideoPlayer1.Stop
VideoPlayer1.Stop();

Seek

method
Seek(seconds: number): void;
Example
VideoPlayer1.Seek
VideoPlayer1.Seek(10);

SetQuality

method
SetQuality(value: WebVideoPlayerQuality): void;
Example
VideoPlayer1.SetQuality
VideoPlayer1.SetQuality('auto');

Unload

method
Unload(): Promise<void>;
Example
VideoPlayer1.Unload
await VideoPlayer1.Unload();

dispose

method
dispose(): void;
Example
VideoPlayer1.dispose
// Call only when disposing of an instance whose lifecycle you control.
VideoPlayer1.dispose();
Inherited members (25)
MemberSignatureAccess
currentRowBindingscurrentRowBindings: readonly WebCurrentRowBinding[];Read and write
elementreadonly element: TElement;Read-only
idreadonly id: string;Read-only
namereadonly name: string;Read-only
visiblevisible: boolean;Read and write
collapseWhenHiddencollapseWhenHidden: boolean;Read and write
xx: number;Read and write
yy: number;Read and write
widthwidth: number;Read and write
heightheight: number;Read and write
marginOuter spacing on all four sides, in pixels.margin: number;Read and write
marginTopmarginTop: number;Read and write
marginRightmarginRight: number;Read and write
marginBottommarginBottom: number;Read and write
marginLeftmarginLeft: number;Read and write
alignSelfalignSelf: RuntimeLayoutAlignSelf;Read and write
tabIndextabIndex: number;Read and write
backgroundColorbackgroundColor: string;Read and write
colorcolor: string;Read and write
borderColorborderColor: string;Read and write

focus

method
focus(options?: FocusOptions): void;

show

method
show(): void;

hide

method
hide(): void;

bindEvent

method
bindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;

emit

method
emit(eventName: string, detail?: unknown): boolean;

Events

Link methods in Interaction. How to use events.

OnLoaded

WebVideoPlayerLoadedEventDetail in event.detail · source, duration, availableQualities

Signature and example
Interaction → OnLoaded
import type { WebVideoPlayer, WebVideoPlayerLoadedEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1Loaded(
    sender: WebVideoPlayer,
    event: CustomEvent<WebVideoPlayerLoadedEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { source, duration, availableQualities } = event.detail;
    console.log(source, duration, availableQualities);
  }
}

OnPlay

WebVideoPlayerTimeEventDetail in event.detail · currentTime, duration

Signature and example
Interaction → OnPlay
import type { WebVideoPlayer, WebVideoPlayerTimeEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1Play(
    sender: WebVideoPlayer,
    event: CustomEvent<WebVideoPlayerTimeEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { currentTime, duration } = event.detail;
    console.log(currentTime, duration);
  }
}

OnPause

WebVideoPlayerTimeEventDetail in event.detail · currentTime, duration

Signature and example
Interaction → OnPause
import type { WebVideoPlayer, WebVideoPlayerTimeEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1Pause(
    sender: WebVideoPlayer,
    event: CustomEvent<WebVideoPlayerTimeEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { currentTime, duration } = event.detail;
    console.log(currentTime, duration);
  }
}

OnEnded

WebVideoPlayerTimeEventDetail in event.detail · currentTime, duration

Signature and example
Interaction → OnEnded
import type { WebVideoPlayer, WebVideoPlayerTimeEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1Ended(
    sender: WebVideoPlayer,
    event: CustomEvent<WebVideoPlayerTimeEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { currentTime, duration } = event.detail;
    console.log(currentTime, duration);
  }
}

OnTimeUpdate

WebVideoPlayerTimeEventDetail in event.detail · currentTime, duration

Signature and example
Interaction → OnTimeUpdate
import type { WebVideoPlayer, WebVideoPlayerTimeEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1TimeUpdate(
    sender: WebVideoPlayer,
    event: CustomEvent<WebVideoPlayerTimeEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { currentTime, duration } = event.detail;
    console.log(currentTime, duration);
  }
}

OnBuffering

WebVideoPlayerBufferingEventDetail in event.detail · buffering

Signature and example
Interaction → OnBuffering
import type { WebVideoPlayer, WebVideoPlayerBufferingEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1Buffering(
    sender: WebVideoPlayer,
    event: CustomEvent<WebVideoPlayerBufferingEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { buffering } = event.detail;
    console.log(buffering);
  }
}

OnQualityChange

WebVideoPlayerQualityEventDetail in event.detail · requested, current

Signature and example
Interaction → OnQualityChange
import type { WebVideoPlayer, WebVideoPlayerQualityEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1QualityChange(
    sender: WebVideoPlayer,
    event: CustomEvent<WebVideoPlayerQualityEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { requested, current } = event.detail;
    console.log(requested, current);
  }
}

OnError

Error in event.detail

Signature and example
Interaction → OnError
import type { WebVideoPlayer } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoPlayer1Error(
    sender: WebVideoPlayer,
    event: CustomEvent<Error>,
  ): Promise<void> {
    Message(event.detail.message);
  }
}
WebRAD · Atentor · Read in Markdown
Source code: 6a562bda75a0 (with local changes) · November 7, 2026

Search documentation

Type to search APIs, components, and events.