Skip to content

feat(vtt-controls): add a caption language picker - #50

Open
Stoffberg wants to merge 3 commits into
masterfrom
feat/caption-track-picker
Open

Stoffberg wants to merge 3 commits into
masterfrom
feat/caption-track-picker

Conversation

@Stoffberg

@Stoffberg Stoffberg commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Apps had to build their own caption language picker. This adds a customizable Radix Select menu and keeps the caption hook available for custom controls. It also fixes captions staying hidden when their tracks load before playback starts.

Testing

  • Choose English, French and Off before playback or while paused; the matching caption appears and Off hides captions. Default captions also appear when loaded before playback.
  • Select captions with the keyboard, use fullscreen or change languages in separate players; the menu restores focus after selection, and each player's choice stays independent.

Evidence

Before: the caption picker uses a native dropdown.

radix-before.mp4

After: the caption picker uses a customizable Radix menu, and language changes keep captions in sync.

radix-after.mp4

Before the caption fix: choose English and French before starting playback; both captions stay hidden.

captions-before.mp4

After the caption fix: choose English, French and Off before starting playback. The matching captions appear, and Off hides them while the video stays paused at the start.

captions-after.mp4

@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-av-uegr Ready Ready Preview Oct 12, 2026 8:23am UTC

@Stoffberg
Stoffberg force-pushed the feat/caption-track-picker branch from b8fc0bd to 809a706 Compare October 11, 2026 15:04
@Stoffberg
Stoffberg changed the base branch from test/browser-e2e to master October 11, 2026 15:05
@Stoffberg Stoffberg self-assigned this Oct 11, 2026
@Stoffberg
Stoffberg requested review from Wykerd and removed request for Wykerd October 11, 2026 15:26
Add `CaptionTrackSelect`, a native select that lists "Off" plus one
option per subtitle or caption track, named by its label or language.
Choosing a track shows only that track and choosing "Off" hides them
all. The `useMediaCaptionTracks` hook exposes the tracks, the showing
one, and `select(track | null)` for building custom caption menus.

Unchosen tracks are set to hidden rather than disabled so their cues
stay active and show immediately when picked while paused. Picking a
track fires the track list's change event, as a native TextTrackList
does on mode changes, so every picker for that media stays in sync.

This branch was successfully deployed

1 active deployment
Preview — 1bafe8c1 Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant