feat: style native Cast subtitles

This commit is contained in:
2026-10-17 17:20:27 +02:00
parent d2aa949f54
commit 117bf77902
3 changed files with 14 additions and 2 deletions
+2
View File
@@ -63,6 +63,8 @@ Open media, select the **Cast** icon or **Playback → Cast to Device → Find C
Existing controls operate remote playback. **Play on This Mac** returns to local playback at the receiver's position. Opening different media ends casting. Frame stepping and YouTube quality changes are local-only; live Cast playback is not seekable. Cast output is limited to 1080p/30 fps. The screen-and-triangle icon does not provide AirPlay support.
External Cast subtitles use white sans-serif text with a black outline, transparent background and no enclosing window. Font scale currently uses the receiver default (1.0), pending physical-TV tuning. Language selection and Off remain independent of video delivery; no subtitle burn-in is used.
Cast trusts the selected LAN endpoint's self-signed certificate; use it only on a trusted network. Receiver captions and perceived A/V synchronization still need physical-device verification.
## Command line
+10
View File
@@ -421,6 +421,16 @@ final class CastSession {
]
if media.duration > 0, !media.live { info["duration"] = media.duration }
if !media.tracks.isEmpty {
info["textTrackStyle"] = [
"foregroundColor": "#FFFFFFFF",
"backgroundColor": "#00000000",
"edgeType": "OUTLINE",
"edgeColor": "#000000FF",
"fontGenericFamily": "SANS_SERIF",
"fontStyle": "NORMAL",
"fontScale": 1.0, // Receiver default; tune against physical TV output.
"windowType": "NONE"
]
info["tracks"] = media.tracks.map { track -> [String: Any] in
["trackId": track.id, "type": "TEXT", "subtype": "SUBTITLES",
"trackContentId": track.url.absoluteString, "trackContentType": "text/vtt",
+2 -2
View File
@@ -1,5 +1,5 @@
- [ ] improve chrome cast subtitle rendering
- maybe this will require stamping the subtitles into the video frames manually before submission to the chrome cast (depending on what it supports)
- [x] improve chrome cast subtitle rendering
- native WebVTT style: white sans-serif, black outline, transparent background; physical-TV font-scale tuning remains unverified
- [ ] add playlist support
- maybe by allowing multiple file selection? 🤔
- [ ] in the "choose what to play" screen, we should change the youtube button to general streaming