Reference
Every prop, part and keyboard shortcut.
API
Each player takes every native prop of the element it wraps, except controls. These are the extra props.
VideoPlayer
- className
- Classes for the <video> element itself.
- frameClassName
- Classes for the outer frame. Use this for size, radius and placement.
- tracks
- WebVTT caption or subtitle files: { src, label, srcLang, kind?, default? }.
- loader
- Adapter for sources the browser cannot play natively, such as HLS.
- metadata
- Title, artist, album and artwork for lock screens and OS media controls.
- persistKey
- Remember volume, mute and speed in localStorage under this key.
- tooltips
- Small labels with their shortcut over the controls on hover and focus. On by default.
AudioPlayer
- title
- The main line beside the controls.
- description
- The muted line after the title.
- artwork
- Cover image beside the controls and in OS media controls.
- showSpeed
- Show a playback speed toggle, for podcasts and voice notes.
- tooltips
- Same as on VideoPlayer. On by default.
- frameClassName
- Classes for the outer frame. className targets the <audio> element.
- loader
- Same as on VideoPlayer.
- metadata
- Overrides the metadata built from title, description and artwork.
- persistKey
- Same as on VideoPlayer.
- MediaRoot
- Owns the store. Exposes data-paused, data-started, data-waiting, data-idle, data-fullscreen.
- MediaVideo / MediaAudio
- The native element. Every native prop passes through.
- MediaSurface
- Full-bleed click target. First tap on touch reveals controls.
- MediaControls
- Reveals on pointer activity, pause, or keyboard focus.
- MediaSeek / MediaVolume
- Accessible sliders with scrubbing, buffering and keyboard steps. MediaVolume takes orientation="vertical" for a popover.
- MediaTime
- current, duration or remaining. toggle lets a click switch to remaining time and back.
- MediaButton
- The base button the others are built from. Use it for your own controls.
- Media*Button
- MediaPlayButton, MediaMuteButton, MediaCaptionsButton, MediaFullscreenButton, MediaPictureInPictureButton, MediaPlaybackRateButton.
- MediaSettings
- Speed and caption track menu.
- MediaCaptions
- Renders the active cue with your styles instead of the browser's.
- MediaLoading / MediaErrorMessage
- Buffering indicator and a retryable error state.
- useMedia(selector)
- Subscribe to any slice of state. Re-renders only when it changes.
- useMediaStore()
- Imperative access: play, seek, setVolume, setTextTrack and more.
- Play or pause
- SpaceK
- Seek 10 seconds
- JL
- Seek 5 seconds
- Volume
- Jump to 0–90%
- 09
- Start or end
- HomeEnd
- Mute
- M
- Captions
- C
- Picture-in-picture
- I
- Fullscreen
- F