Repository navigation
feat(infra): captions in the hosted player and embed - #4187
Merged
Merged
Conversation
…list them for the player
hls.js cleared the cues of every text track when a manifest loaded, which briefly showed a caption track that had no source yet. Chrome then kept that track in its error state after the source arrived. Turn off the hls.js caption parts Cap's streams never use, and make each caption track only once its file has loaded.
…into feat/infra-player-captions
richiemcilroy
marked this pull request as ready for review
November 13, 2026 07:05
|
Sandchest reviewed Sandchest reviews every change for vulnerabilities an attacker could use · 5 credits · Review details |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Member
Author
|
hey @greptileai, please re-review the PR |
…tions # Conflicts: # apps/web/app/(infra)/dashboard/infra/infra-data.ts
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
…into feat/infra-player-captions
Member
Author
|
hey @greptileai, please re-review the PR |
…into feat/infra-player-captions
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stacked on #4171 (Safari start), which merges first. This rebases onto main after that, so do not merge it before #4171.
A video that has captions from #4134 now shows them in Cap's hosted player and embed. Viewers get a CC button and the
ckey, and an embed can start with them on withcaptions=1.What changes
DeveloperVideoPlayer(kind: "playing") gainscaptions: { language, label, url }[] | null. It isnullfor a video with no completed transcript with speech. Built bydeveloperVideoCaptionTracks(apps/web/lib/developer-video-captions.ts) from feat(infra): transcribe a stored video by id and write its captions #4134'sdeveloperVideoCaptions. A failed lookup logs and plays without captions.captions-<lang>.vtt(for examplecaptions-en.vtt,captions-pt-br.vtt,captions-und.vtt) is served by the existing/api/developer/playback/[playbackId]/[file]route.404, paused app402, and the samepublic, max-age=60, s-maxage=60and CORS headers.<track>loads in same-origin mode unless its<video>setscrossorigin, so it cannot follow a redirect to storage on another origin, and settingcrossoriginwould change how every media file loads. No storage URL or key is handed out, and no new bucket access is added.^captions-([a-z]{2,3}(-[a-z0-9]{2,8})*)\.vtt$, so the key is alwaysdeveloper/<appId>/<videoId>/captions/<lang>.vttfor that video.apps/web/components/cap-player):aria-pressed, the player's focus ring, and theckey. With more than one language it opens the same menu as speed and quality (Off plus each language).<track>as a blob URL, and the track runs inhiddenmode.showingso the browser draws it.source.ts). Cap's streams have neither. Left on, they clear the cues of every text track when a manifest loads and switch tracks off when hls.js detaches.captions=1(ortrue) starts with captions on.captions=0, absent, or any other value keeps them off. It applies to the embed only, likeautoplay,muted,loopandcontrols. Documented in the REST docs' embed parameter table and the OpenAPIembedUrldescription.captions=1tick. The note under Captions says to addcaptions=1to the embed link./s/...) do not usecap-playerand are untouched.cap-playeris imported only by the Infra pages (/dev/...), the Infra console and the Infra landing film.Screenshots
Captured on the Mac mini against production playback of a temporary Cap Infra video (uploaded, transcribed through #4134, then deleted). The cues are #4134's WebVTT writer output for that transcript.
captions=1, playingBrowser proof
cignoredcoff and oncaptions=1on from the start,captions=0offcaptions=1)controls=0&captions=1shows cuescaptions=1ckey went through the driver's keyboard input.next devwith production playback for the video. The WebVTT came from a stand-in server on another origin that sends the route's exact headers, because production does not servecaptions-*.vttuntil this ships. That is the harder case for the player (cross-origin), and the route itself is covered by unit tests. A real-deployment check ofcaptions-en.vttbelongs in the post-merge smoke.

Confidence Score: 5/5
The PR appears safe to merge after its stated prerequisite.Summary
Adds captions to the hosted Infra player, embeds, and console.
This review used the full PR because the merge-base checks did not pass. Checks were limited to source inspection; no tests or browser checks were run.
Reviews (11) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile