fix: subtitles centred and quieter

The captions were pinned to one side and set for a television across a
room. Verified fixed in the running app: centred at the bottom of the
picture, smaller, on a translucent ground instead of solid black.

The position was not in the file — the embedded track extracts to
WebVTT with no cue settings at all. It was the element's in-band
rendering: WebKit hands a container's own subtitle stream to the media
pipeline, which places it wherever the container's text box points and
which no CSS can reach.

So the player reads the stream out of the file with ffmpeg — about
40ms, no re-encoding — and attaches it as an ordinary track. The
download stays one self-contained file; the cues become ours to place
and style. The file's own track is filtered out of the menu and left
disabled, or the same captions would be offered twice and the in-band
copy would render underneath.

Cue styling: 58% of WebKit's default size, on slate at 55% rather than
opaque black.
This commit is contained in:
vincent
2026-08-29 17:35:09 +02:00
parent 2121f3e475
commit 8dade59bb4
6 changed files with 123 additions and 25 deletions
+4
View File
@@ -61,6 +61,10 @@ export const updateYtDlp = () => invoke<string>("update_yt_dlp");
export const listSubtitles = (videoId: string) =>
invoke<Array<[string, string]>>("list_subtitles", { videoId });
/** Subtitles read out of a downloaded file, as (language, WebVTT text). */
export const embeddedSubtitles = (videoId: string) =>
invoke<Array<[string, string]>>("embedded_subtitles", { videoId });
/** Subtitles as (language, WebVTT text) — fetched and cached when there are
* none beside the video. Streaming has no other source. */
export const fetchSubtitles = (videoId: string, lang: string) =>