feat: in-player subtitles — c toggles captions (Phase 4)#27
Merged
Conversation
Pressing c in the player lazily fetches the item's subtitle tracks
(GET /media/{id}/subtitles), picks the default (or first), fetches that track's
WebVTT (GET /media/{id}/subtitles/{index}) and parses it with sugar-reel's
WebVtt; the active cue is then centered on a caption line above the scrubber, and
c flips it on/off. All best-effort — no tracks or a failed fetch just leaves
captions off. A caption row is always reserved so toggling never reflows the
video.
384 tests; PlayerScreen 98.3%, SubtitleTrack 100%.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Phase 4 — subtitle overlay, part 3 of 3 (client)
Wires the sugar-reel
WebVttparser (sugarcraft#1099) + the server endpoint (phlix-server#306) into the player.Behaviour
clazily fetches the item's subtitle tracks (GET /media/{id}/subtitles), picks the default (or first), fetches that track's WebVTT (GET /media/{id}/subtitles/{index}), and parses it with sugar-reel'sWebVtt. Afterwardscjust flips visibility.cueAt(position)) is rendered centered on a caption line above the scrubber; the status hint showsc cc✓when on.cdoesn't refetch).CHROME_ROWS3 → 4 — a caption row is always reserved, so toggling captions never reflows/resizes the video.Pieces
SubtitleTrackDTO;ApiClient::subtitleTracks(JSON) +ApiClient::subtitleVtt(rawtext/vttbody, no refresh-retry);SubtitleVttLoadedMsg.Tests — 366 → 384 green
PlayerScreen98.3% (uncovered = pre-existing defensive guards),ApiClient98.0%,SubtitleTrack100%. Covers toggle-on→fetch→show-active-cue, toggle-off-hides, cue-gap (nothing shown), no-tracks (stays off, no refetch), swallowed fetch failure; ApiClient track mapping + raw VTT body + non-2xx throws.🤖 Generated with Claude Code