Headless media toolkit for React
Media players,
built to your spec.
React AV handles playback state, captions, streaming and timeline editing. Compose it with hooks and unstyled components, and keep every pixel of the interface your own.
npm i @react-av/core- HeadlessNo CSS shipped. Every part takes your classes.
- WebVTTSpec-based parser and renderer for captions.
- HLS + DASHAdaptive streaming through Shaka Player.
- TypedWritten in TypeScript, declarations included.
One player.
Any skin.
Three skins on one <Media.Root>. Switch while it plays: position, volume and captions carry over because only the markup changes.
Interactive React video player
A timeline editor you can ship.
Subtitle editing as composable parts. Restyle it for a studio tool or a course builder without forking a line.
Select a cue to edit it, drag across the track to add one, or use the arrow keys to nudge timing.
Build a React subtitle editor →Interactive React subtitle editor
editor.tsx
<Media.Root>
<Track kind="subtitles" src="/lesson.vtt" id="captions" />
<Editor mediaComponent={<Media.Video src="/lesson.mp4" />}>
<TimelineEditor>
<TimelineControlBar />
<TimelineContainer>
<TimelineHeader />
<TimelineSubtitlesTrack id="captions">
<TimelineSubtitleCueEditor />
</TimelineSubtitlesTrack>
</TimelineContainer>
</TimelineEditor>
</Editor>
</Media.Root>Sync anything to playback.
Every piece of media state is a hook. Lyrics, transcripts, quizzes, chapter lists: read the clock, render what you like.
Add WebVTT captions to React →Interactive lyrics and audio player
lyrics.tsx
function Lyrics() {
const [cues, active] = useMediaTextTrack("lyrics");
const [, seek] = useMediaCurrentTime();
return cues.map(cue => (
<Cue as="li" cue={cue} key={cue.startTime}
data-active={active.includes(cue)}
onClick={() => seek(cue.startTime)} />
));
}Take only what you need.
- @react-av/coreRoot, media elements, viewport and state hooks.
- @react-av/controlsPlay, mute, loop, fullscreen, PiP and timestamps.
- @react-av/slidersSeek and volume sliders built on Radix UI.
- @react-av/vtt-coreStandalone WebVTT parser and renderer.
- @react-av/vttTracks, cues and caption overlays.
- @react-av/vtt-controlsStoryboard thumbnails from WebVTT.
- @react-av/shakaHLS and DASH playback via Shaka Player.
- @react-av/editorTimeline and subtitle editing components.