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
+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",