Video

Video provides controlled playback of live or VOD content with optional built-in UI, trick play, and captions

import { Video } from "@roku-sdk/components";
Video(props: IVideoProps): JSX.Element

Description

Video provides controlled playback of live or VOD content with optional built-in UI, trick play, and captions.

Parameters

NameTypeDescription
propsIVideoProps

Example

<video
  width={1280}
  height={720}
  content={<VideoContentNode url={url} />}
  control="play"
  onState={state => console.log(state)}
/>

Types

IVideoProps

All Video node props: extends Group with playback, trick play, UI, captions, audio, and misc fields.

Extends IGroupProps, IVideoPlaybackProps, ITrickPlayProps, IVideoUiProps, IVideoCaptionProps, IVideoAudioProps, IVideoMiscProps.

IAudioSelectionPreferences

Audio track selection preferences (Roku OS 12.5+).

NameTypeDescription
overrideSystemboolean
valuesAudioSelectionPreferenceRule[]

GlobalCaptionMode

Global Roku closed-caption mode for the Video globalCaptionMode field.

MemberValueDescription
Off"Off"
On"On"
InstantReplay"Instant replay"
WhenMute"When mute"

IVideoAudioTrack

One entry of the Video node availableAudioTracks field.

Firmware always emits every key below; the TypeScript and BrightScript bridges both build each entry from the media player's audio track list.

NameTypeDescription
FormatstringHuman-readable audio format description from the demuxer, for example "ISO/IEC 14496-3, Advanced Audio Coding, ADTS container". Not listed in the Roku docs; may be an empty string when the demuxer reports no format.
HasAccessibilityDescriptionbooleanHLS "public.accessibility.describes-video", or a DASH audio description.
HasAccessibilityEAIbooleanDASH Enhanced Audio Intelligibility track.
LanguagestringLanguage code as declared by the stream. Roku docs describe an ISO 639-2 three-letter code ("eng"), but the value is passed through from the manifest, so two-letter codes such as "en" also occur.
NamestringDescriptive name of the audio track.
TrackstringTrack identifier; assign it to audioTrack to select the track.

IVideoSubtitleTrack

One entry of the Video node availableSubtitleTracks field.

Firmware always emits every key below.

NameTypeDescription
DescriptionstringDescriptive name of the subtitle track.
HasAccessibilityCaptionbooleanHLS "public.accessibility.transcribes-spoken-dialog", or DASH captions.
HasAccessibilityDescriptionbooleanHLS "public.accessibility.describes-music-and-sound".
HasAccessibilitySignbooleanDASH sign-language interpretation.
LanguagestringLanguage code as declared by the stream. Roku docs describe an ISO 639-2 three-letter code ("eng"), but two-letter codes such as "en" also occur.
TrackNamestringTrack identifier; assign it to subtitleTrack to select the track.

IDecoderStats

Video decoder statistics when IVideoPlaybackProps.enableDecoderStats is true.

NameTypeDescription
frameDropCountnumber
renderCountnumber
repeatCountnumber
streamErrorCountnumber

IDownloadedSegmentInfo

Information about a segment that was just downloaded.

NameTypeDescription
bitrateBPSnumber
downloadDurationnumber
hdrModeDownloadedSegmentHdrMode
heightnumber
pathstring
segDurationstring
segSequencenumber
segSizenumber
segStartnumber
segTypenumber
segUrlstring
statusnumber
widthnumber

VideoErrorInfo

Structured error information from the Video node errorInfo field.

NameTypeDescription
categorystring
clipIdnumber
dbgmsgstring
drmerrcodenumber
errcodenumber
ignorednumber
sourcestring

ILicenseStatus

DRM license acquisition status from the Video node.

NameTypeDescription
durationstring
keysystemstring
responsestring
statusstring

IPlayStartInfo

Timing measurements related to the start of video playback (seconds unless noted).

NameTypeDescription
drm_lic_acq_durnumber
drm_lic_acq_startnumber
drm_load_durnumber
drm_load_startnumber
manifest_durnumber
manifest_startnumber
prebuf_durnumber
prebuf_startnumber
total_durnumber

IPositionInfo

Position info for last rendered audio/video samples.

NameTypeDescription
audionumber
clip_idnumber
epochnumber
videonumber

IStreamingSegmentInfo

Information about the video segment currently streaming (HLS/DASH).

NameTypeDescription
hdrModeStrStreamingSegmentHdrMode
heightnumber
latencynumber
pathstring
segBitrateBpsnumber
segSequencenumber
segStartnumber
segTypenumber
segTypeStrStreamingSegmentType
segUrlstring
widthnumber

IPlaybackActionButton

One playback action button on the pause screen.

NameTypeDescription
buttonIsDisabled?boolean
focusIcon?Uri
icon?Uri
text?string

VideoSeekMode

Seek accuracy for the Video node seekMode field.

MemberValueDescription
Default"default"
Accurate"accurate"

ISubtitleSelectionPreferences

Subtitle track selection preferences (Roku OS 12.5+).

NameTypeDescription
overrideSystemboolean
valuesSubtitleSelectionPreferenceRule[]

IVideoPlaybackProps

Playback-related fields for the Video node: content, control, errors, and DRM.

NameTypeDescription
asyncStopSemantics?booleanWhen true, STOP runs asynchronously (Roku OS 12.5+). state becomes stopping then stopped.
audioSelectionPreferences?IAudioSelectionPreferencesAudio track selection priority (write-only configuration).
content?ElementContentNode (or playlist parent) with content metadata for playback.
contentIsPlaylist?booleanWhen true, children of content form a video playlist.
control?MediaControlPlay state command (play, pause, stop, prebuffer, etc.).
enableDecoderStats?booleanWhen true, decoderStats is populated and updated.
nextContentIndex?numberNext playlist index to play after the current item ends or is skipped.
onContentIndex?EventHandler<number>Index of the current item in a playlist (or 0 for single content).
onDecoderStats?EventHandler<IDecoderStats>Fired when decoder statistics are updated (requires enableDecoderStats).
onErrorCode?EventHandler<number>Fired when errorCode changes after an error state.
onErrorInfo?EventHandler<VideoErrorInfo>Fired when structured errorInfo is updated.
onErrorMsg?EventHandler<string>Fired when errorMsg changes.
onErrorStr?EventHandler<string>Fired when errorStr changes.
onLicenseStatus?EventHandler<ILicenseStatus>Fired when DRM license status changes.
onPlayStartInfo?EventHandler<IPlayStartInfo>Fired when play-start timing info is updated.
onState?EventHandler<MediaState>Fired when playback state changes (buffering, playing, error, etc.).
playbackActionButtonFocused?numberFocused index in playbackActionButtons.
playbackActionButtonFocusedTextColor?stringText color when the playback action button has focus.
playbackActionButtonFocusedTextFont?stringFont for the focused playback action button label.
playbackActionButtonFocusIndicatorBlendColor?stringBackground blend color when the playback action button has focus.
playbackActionButtons?IPlaybackActionButton[]Buttons and UI on the pause screen at start of playback.
playbackActionButtonSelected?numberSelected index in playbackActionButtons.
playbackActionButtonUnfocusedTextColor?stringText color when the playback action button does not have focus.
playbackActionButtonUnfocusedTextFont?stringFont for unfocused playback action button labels.
subtitleSelectionPreferences?ISubtitleSelectionPreferencesSubtitle track selection priority (write-only configuration).

ITrickPlayProps

Trick play, seek, segments, and related timing fields.

NameTypeDescription
autoplayAfterSeek?booleanWhen false, disables auto-play after rebuffer following a seek.
enableLiveAvailabilityWindow?booleanEnables trick play bar scrubbing within the live availability window.
enableThumbnailTilesDuringLive?booleanWhen true, thumbnailTiles updates during live HLS/DASH with thumbnails.
loop?booleanWhen true, restarts playlist or single content after the end.
notificationInterval?numberSeconds between position observer notifications; 0 disables notifications.
onClipId?EventHandler<number>Fired when the current clip ID changes.
onDownloadedSegment?EventHandler<IDownloadedSegmentInfo>Fired when a segment download completes.
onDuration?EventHandler<number>Fired when stream duration is known or changes.
onPosition?EventHandler<number>Fired on position updates (interval from notificationInterval).
onPositionInfo?EventHandler<IPositionInfo>Fired with last rendered sample positions.
onStreamingSegment?EventHandler<IStreamingSegmentInfo>Fired with info about the segment currently being streamed.
seek?numberSeek target in seconds from stream start (write-only).
seekMode?VideoSeekModeSeek accuracy: default (keyframe) vs accurate (if supported).
thumbnailTiles?Record<string, unknown>Thumbnail tile sets from the manifest (structure varies by OS version).
timedMetaDataSelectionKeys?string[]Keys for timed metadata (e.g. ID3); matching tags populate timedMetaData / timedMetaData2.
trickPlayBackgroundOverlay?UriBackground overlay URI while playback UI is visible.

IVideoUiProps

Built-in Video UI: dimensions, toggles, and internal bar/BIF/pivot nodes.

NameTypeDescription
bifDisplay?ElementBIF display sub-node instance.
bufferingBar?ElementBuffering progress bar sub-node instance.
bufferingTextColor?stringText color near the buffering bar (0 = system default).
enableTrickPlay?booleanWhen false, remote trick play keys have no effect (requires enableUI).
enableUI?booleanWhen false, hides most built-in UI (app implements custom UI).
height?numberVideo window height in pixels; 0 uses full display height.
pivotNode?ElementPivot renderable shown when video is paused.
retrievingBar?ElementInitial retrieve progress bar sub-node instance.
retrievingTextColor?stringText color near the retrieving bar (0 = system default).
trickPlayBar?ElementTrick play bar sub-node instance.
width?numberVideo window width in pixels; 0 uses full display width.

IVideoCaptionProps

Closed caption and subtitle styling fields.

NameTypeDescription
captionStyle?Record<string, string>Caption styling keys (Text/Font, Text/Size, Background/Color, etc.) per Roku docs.
globalCaptionMode?GlobalCaptionModeGlobal caption mode; app should still set subtitleTrack as needed.
onAvailableSubtitleTracks?EventHandler<IVideoSubtitleTrack[]>Fired with the subtitle tracks found in the stream and content metadata (read-only on the node).
onCurrentSubtitleTrack?EventHandler<string>Fired when the playing subtitle track changes; carries the track identifier (TrackName).
subtitleTrack?stringSelected subtitle track identifier (read/write).
suppressCaptions?booleanSuppresses captions when resolving UI overlap conflicts.

IVideoAudioProps

Audio output and track selection fields.

NameTypeDescription
audioTrack?stringSelected audio track identifier (prefer platform selection when possible).
mute?booleanMutes or restores audio for the current stream.
onAvailableAudioTracks?EventHandler<IVideoAudioTrack[]>Fired with the audio tracks found in the stream (read-only on the node).
onCurrentAudioTrack?EventHandler<string>Fired when the playing audio track changes; carries the track identifier (Track).
seamlessAudioTrackSelection?booleanWhen true, continues video on audio track switch (HLS only; set before any control command).
supplementaryAudioVolume?numberDescription track volume vs main audio (0–100).

IVideoMiscProps

Decode resolution, output protection, and screensaver behavior.

NameTypeDescription
cgms?numberCGMS level for analog outputs (0–3 per Roku docs).
disableScreenSaver?booleanSuppresses screensaver (e.g. audio-only).
enableScreenSaverWhilePlaying?booleanAllows screensaver when video covers less than half the screen.
maxVideoDecodeResolution?Vector2DMax decode resolution [width, height]; [0,0] means unlimited per axis.

AudioSelectionPreferenceRule

One rule object in audio selection preferences (ordered highest to lowest significance).

type AudioSelectionPreferenceRule = { language: string[] } | { descriptive: string | string[] };

DownloadedSegmentHdrMode

HDR mode enum for downloadedSegment info.

MemberValueDescription
Unknown0
None1
Hdr102
DolbyVision3
Hlg104
Hdr10Plus5
SlHdr26

StreamingSegmentHdrMode

HDR mode reported on streamingSegment (HLS/DASH).

MemberValueDescription
Invalid"invalid"
Unknown"unknown"
None"none"
Hdr10"hdr10"
DolbyVision"dolby_vision"
Hlg10"hlg10"
SlHdr2"sl-hdr2"

StreamingSegmentType

Segment payload type from streamingSegment.segTypeStr.

MemberValueDescription
Audio"audio"
Video"video"
Captions"captions"
Mux"mux"

SubtitleSelectionPreferenceRule

One rule object in subtitle selection preferences (ordered highest to lowest significance).

type SubtitleSelectionPreferenceRule = { language: string[] } | { caption: string } | { descriptive: string | string[] } | { easyReader: string };

What’s Next

Did this page help you?