feat: style native Cast subtitles
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user