Renders the single child with a part's behaviour, instead of the part's element.
BufferingIndicator
Sets data-visible while stalled. It writes to the DOM directly, with no renders.
Button
A control button. data-control is what the skin styles.
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
ControlGroup
A pill of related controls.
ControlRow
Controls
Holds the controls. Stays mounted while hidden, so Tab can reveal it.
CurrentTime
Current position. Writes to the DOM directly, so playback causes no renders.
Duration
ErrorOverlay
Explains a fatal error in the viewer's language, with a code to quote to support, in place of an endless spinner. It offers a retry unless the error rules that out.
Prop
Type
Description
title?
string
Replaces the title, whatever the error.
messages?
Partial<Record<VideoErrorCode, ErrorMessage>>
Replaces the text for particular error codes.
Media
The media element. The active provider owns its source, so this renders no src or <source> children. Pass <track> elements as children.
Menu
A menu that renders inside the player, so it keeps working in fullscreen. Submenus drill down in place rather than opening beside it.
Prop
Type
Description
children?
ReactNode
The menu's trigger and content.
onOpenChange?
((open: boolean) => void)
Called as the menu opens and closes.
MenuContent
Prop
Type
Description
children?
ReactNode
The rows at the top level of the menu.
MenuItem
Prop
Type
Description
disabled?
boolean
Stops the item being chosen or reached with the keyboard.
onSelect?
(() => void)
Runs when chosen. The menu closes afterwards unless keepOpen is set.
keepOpen?
boolean
Leaves the menu open after the item is chosen.
MenuRadioGroup
Prop
Type
Description
value
string | null
The value of the checked item, or null when none is checked.
onValueChange
(value: string) => void
Called with an item's value when the viewer chooses it.
MenuRadioItem
Prop
Type
Description
value
string
Identifies this item to the group, and is what onValueChange receives.
MenuSub
A row that drills down to a panel of its own.
Prop
Type
Description
title
ReactNode
The row's name, which also titles the submenu.
value?
ReactNode
The current value, shown at the end of the row. A value that changes during playback should be a component that reads it, so that nothing renders until the menu is open.
icon?
ReactNode
Shown before the title.
backLabel?
string
Labels the back button.
MenuTrigger
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
Mute
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayOverlay
The large button over the video, shown before playback starts and after it ends.
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayPause
Prop
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayerContext
RemainingTime
Time left, written to the DOM directly like CurrentTime.
Root
Provides the player to its parts. Never re-renders because of playback.
Prop
Type
Description
src?
SourceInput | null
The video to play, which loads afresh when its value changes.
plugins?
readonly AnyPlugin[]
Set once. Define the array outside the component or memoize it.
load?
LoadStrategy
When the provider and its engine load. Set once. Defaults to eager.
player?
Player
Bring your own player instead of creating one.
onError?
((error: MediaErrorInfo) => void)
Called with every error, fatal or not, for logging. It can change between renders.
children?
ReactNode
Content rendered inside the player's root element.
SeekButton
Jumps by a fixed amount. Disabled wherever seeking is, such as during an ad.
Prop
Type
Description
seconds
number
Seconds to move. Negative goes back.
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
Slot
Renders what plugins contributed to name, in plugin order.
Prop
Type
Description
name
SlotName
The slot to render, such as overlay or menu.
Timeline
The seek bar. A real range input provides focus, keyboard, and screen reader support, while the visible track takes pointer input over a larger hit area.
Prop
Type
Description
step?
number
Seconds moved by the arrow keys.
largeStep?
number
Seconds moved by Page Up and Page Down.
children?
ReactNode
Replaces the default track, thumb, and preview.
TimelineBuffered
TimelineFill
TimelinePreview
Follows the pointer with the time under it, staying inside the track.
Prop
Type
Description
children?
ReactNode
Shown above the time, such as a thumbnail.
TimelineThumb
The rail spans the track and moves as a whole, so percentages need no measuring.
TimelineTrack
VolumeSlider
Renders nothing where the platform owns volume, such as iOS.
Prop
Type
Description
step?
number
Change per arrow key press, from 0 to 1.
Hooks
useClock
Runs write as playback advances, without rendering. Use this for anything that follows time: fills, thumbs, and text written straight to the DOM.
Compares one level deep, for selectors that build arrays or objects.
<Value>(a: Value, b: Value) => boolean
Types
BufferingIndicatorProps
BufferingIndicatorProps
ButtonProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
ControlGroupProps
ControlGroupProps
ControlRowProps
ControlRowProps
ControlsProps
ControlsProps
CurrentTimeProps
TimeProps
DurationProps
TimeProps
ErrorMessage
Field
Type
Description
title?
string
Replaces the title.
detail?
string
Replaces the line under the title.
ErrorOverlayProps
Field
Type
Description
title?
string
Replaces the title, whatever the error.
messages?
Partial<Record<VideoErrorCode, ErrorMessage>>
Replaces the text for particular error codes.
MediaProps
MediaProps
MenuContentProps
Field
Type
Description
children?
ReactNode
The rows at the top level of the menu.
MenuItemProps
Field
Type
Description
disabled?
boolean
Stops the item being chosen or reached with the keyboard.
onSelect?
(() => void)
Runs when chosen. The menu closes afterwards unless keepOpen is set.
keepOpen?
boolean
Leaves the menu open after the item is chosen.
MenuProps
Field
Type
Description
children?
ReactNode
The menu's trigger and content.
onOpenChange?
((open: boolean) => void)
Called as the menu opens and closes.
MenuRadioGroupProps
Field
Type
Description
value
string | null
The value of the checked item, or null when none is checked.
onValueChange
(value: string) => void
Called with an item's value when the viewer chooses it.
MenuRadioItemProps
Field
Type
Description
value
string
Identifies this item to the group, and is what onValueChange receives.
MenuSubProps
Field
Type
Description
title
ReactNode
The row's name, which also titles the submenu.
value?
ReactNode
The current value, shown at the end of the row. A value that changes during playback should be a component that reads it, so that nothing renders until the menu is open.
icon?
ReactNode
Shown before the title.
backLabel?
string
Labels the back button.
MenuTriggerProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
MuteProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayOverlayProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
PlayPauseProps
Field
Type
Description
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.
RemainingTimeProps
TimeProps
RootProps
Field
Type
Description
src?
SourceInput | null
The video to play, which loads afresh when its value changes.
plugins?
readonly AnyPlugin[]
Set once. Define the array outside the component or memoize it.
load?
LoadStrategy
When the provider and its engine load. Set once. Defaults to eager.
player?
Player
Bring your own player instead of creating one.
onError?
((error: MediaErrorInfo) => void)
Called with every error, fatal or not, for logging. It can change between renders.
children?
ReactNode
Content rendered inside the player's root element.
SeekButtonProps
Field
Type
Description
seconds
number
Seconds to move. Negative goes back.
asChild?
boolean
Merges behaviour onto the single child instead of rendering a button.