Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

VideoPlayer

Play the bundled Pimolu tour with captions.

Preview

Live preview

Changes apply to this preview only.

0:00 / 0:00

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Controlled playback

The parent owns `playing`. Every media event and control click reports through `onPlayingChange`, so an external action bar can drive the same playback state.

Open preview

Muted autoplay and a square frame

Muted autoplay is the only autoplay browsers reliably allow. `aspectRatio` can reserve any frame; `showFullscreen={false}` keeps the control bar minimal.

Open preview

Course lesson

A real-world composition: the player sits above the lesson notes, with a localized control bar and a captions track.

Open preview

Usage

Serve real media with suitable codecs and caption tracks; handle unavailable playback explicitly.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluVideoPlayerLabels

Type source
PimoluVideoPlayerLabels public API
NameTypeDefaultDescription
playerstring | undefined"Video player"Accessible name of the whole player region. Defaults to "Video player".
playstring | undefined"Play"Name of the play button. Defaults to "Play".
pausestring | undefined"Pause"Name of the pause button. Defaults to "Pause".
mutestring | undefined"Mute"Name of the mute button while the sound is on. Defaults to "Mute".
unmutestring | undefined"Unmute"Name of the mute button while the sound is off. Defaults to "Unmute".
volumestring | undefined"Volume"Name of the volume slider. Defaults to "Volume".
timelinestring | undefined"Video timeline"Name of the timeline slider. Defaults to "Video timeline".
fullscreenstring | undefined"Enter fullscreen"Name of the fullscreen button. Defaults to "Enter fullscreen".
exitFullscreenstring | undefined"Exit fullscreen"Name of the fullscreen button while fullscreen. Defaults to "Exit fullscreen".
player

string | undefined

Default: "Video player"

Accessible name of the whole player region. Defaults to "Video player".

play

string | undefined

Default: "Play"

Name of the play button. Defaults to "Play".

pause

string | undefined

Default: "Pause"

Name of the pause button. Defaults to "Pause".

mute

string | undefined

Default: "Mute"

Name of the mute button while the sound is on. Defaults to "Mute".

unmute

string | undefined

Default: "Unmute"

Name of the mute button while the sound is off. Defaults to "Unmute".

volume

string | undefined

Default: "Volume"

Name of the volume slider. Defaults to "Volume".

timeline

string | undefined

Default: "Video timeline"

Name of the timeline slider. Defaults to "Video timeline".

fullscreen

string | undefined

Default: "Enter fullscreen"

Name of the fullscreen button. Defaults to "Enter fullscreen".

exitFullscreen

string | undefined

Default: "Exit fullscreen"

Name of the fullscreen button while fullscreen. Defaults to "Exit fullscreen".

PimoluVideoPlayerProps

Type source
PimoluVideoPlayerProps public API
NameTypeDefaultDescription
srcstring | undefined—Video URL. Sources may also be provided through `captions`/native markup.
captionsReactNode—Captions and subtitles: typically one or more `<track>` elements. They are rendered inside `<video>`, where the browser expects them.
fallbackReactNode—Native fallback content rendered inside `<video>`.
posterstring | undefined—Poster shown before the first frame.
playingboolean | undefined—Controlled playback state. Omit to let the player own it. Changing the prop calls `play()` or `pause()` on the media element.
onPlayingChange((playing: boolean) => void) | undefined—Called whenever playback starts or stops.
mutedboolean | undefinedfalseInitial muted state when the player mounts. Defaults to false.
defaultVolumenumber | undefined1Initial volume, from 0 to 1. Defaults to 1.
seekStepnumber | undefined5Seconds skipped by ArrowLeft and ArrowRight. Defaults to 5.
showFullscreenboolean | undefinedtrueRender the fullscreen button when the browser supports it. Defaults to true.
aspectRatiostring | number | undefined—Aspect ratio reserved for the video box, e.g. `16 / 9`.
classNamestring | undefined—Class applied to the player wrapper.
videoClassNamestring | undefined—Class applied to the native `<video>`.
labelsPimoluVideoPlayerLabels | undefined—Localizable control labels.
onLoadedMetadataReactEventHandler<HTMLVideoElement> | undefined—Called after the media metadata loads.
onTimeUpdateReactEventHandler<HTMLVideoElement> | undefined—Called while the playhead moves.
onPlayReactEventHandler<HTMLVideoElement> | undefined—Called when the media starts playing.
onPauseReactEventHandler<HTMLVideoElement> | undefined—Called when the media pauses.
onEndedReactEventHandler<HTMLVideoElement> | undefined—Called when the media ends.
onVolumeChangeReactEventHandler<HTMLVideoElement> | undefined—Called when the volume or muted state changes.
onDurationChangeReactEventHandler<HTMLVideoElement> | undefined—Called when the duration becomes known or changes.
onClickReactEventHandler<HTMLVideoElement> | undefined—Called when the video surface is clicked. Playback still toggles unless prevented.
onChangeChangeEventHandler<HTMLVideoElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
src

string | undefined

No default extracted.

Video URL. Sources may also be provided through `captions`/native markup.

captions

ReactNode

No default extracted.

Captions and subtitles: typically one or more `<track>` elements. They are rendered inside `<video>`, where the browser expects them.

fallback

ReactNode

No default extracted.

Native fallback content rendered inside `<video>`.

poster

string | undefined

No default extracted.

Poster shown before the first frame.

playing

boolean | undefined

No default extracted.

Controlled playback state. Omit to let the player own it. Changing the prop calls `play()` or `pause()` on the media element.

onPlayingChange

((playing: boolean) => void) | undefined

No default extracted.

Called whenever playback starts or stops.

muted

boolean | undefined

Default: false

Initial muted state when the player mounts. Defaults to false.

defaultVolume

number | undefined

Default: 1

Initial volume, from 0 to 1. Defaults to 1.

seekStep

number | undefined

Default: 5

Seconds skipped by ArrowLeft and ArrowRight. Defaults to 5.

showFullscreen

boolean | undefined

Default: true

Render the fullscreen button when the browser supports it. Defaults to true.

aspectRatio

string | number | undefined

No default extracted.

Aspect ratio reserved for the video box, e.g. `16 / 9`.

className

string | undefined

No default extracted.

Class applied to the player wrapper.

videoClassName

string | undefined

No default extracted.

Class applied to the native `<video>`.

labels

PimoluVideoPlayerLabels | undefined

No default extracted.

Localizable control labels.

onLoadedMetadata

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called after the media metadata loads.

onTimeUpdate

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called while the playhead moves.

onPlay

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called when the media starts playing.

onPause

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called when the media pauses.

onEnded

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called when the media ends.

onVolumeChange

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called when the volume or muted state changes.

onDurationChange

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called when the duration becomes known or changes.

onClick

ReactEventHandler<HTMLVideoElement> | undefined

No default extracted.

Called when the video surface is clicked. Playback still toggles unless prevented.

onChange

ChangeEventHandler<HTMLVideoElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

Accessibility

  • Provide captions, keyboard-operable controls and a transcript for essential spoken content.
Read the accessibility guide →