feat: support YouTube VTT subtitle selection
This commit is contained in:
@@ -879,6 +879,12 @@ struct CastSessionCheck {
|
||||
try await until("Disconnect STOP reaches receiver") { peer.commands.contains { $0.0 == "STOP" } }
|
||||
let load = peer.commands.first { $0.0 == "LOAD" }!.1
|
||||
require(load["currentTime"] as? Double == 9.25 && load["autoplay"] as? Bool == false, "Acknowledged paused handoff")
|
||||
if ProcessInfo.processInfo.environment["TEREBI_CAST_YOUTUBE_SOURCE"] != nil {
|
||||
let media = load["media"] as! [String: Any]
|
||||
require((media["tracks"] as? [Any] ?? []).isEmpty &&
|
||||
(load["activeTrackIds"] as? [Any] ?? []).isEmpty,
|
||||
"YouTube Cast LOAD contains no captions or invalid local track selection")
|
||||
}
|
||||
require(peer.relayVerified, "Receiver fetches real relay HLS and media bytes")
|
||||
}
|
||||
|
||||
@@ -1034,6 +1040,11 @@ struct CastSessionCheck {
|
||||
print("PASS: latest slider intent, stale volume feedback, authoritative acknowledgement, external TV changes, timeout")
|
||||
return
|
||||
}
|
||||
if CommandLine.arguments.count == 4, CommandLine.arguments[1] == "--youtube-subtitles" {
|
||||
try await playback(identity: identity, executable: CommandLine.arguments[2], file: CommandLine.arguments[3])
|
||||
print("PASS: YouTube Cast omits optional captions and restores the local choice on return")
|
||||
return
|
||||
}
|
||||
if CommandLine.arguments.count == 4, CommandLine.arguments[1] == "--playback" {
|
||||
try await playback(identity: identity, executable: CommandLine.arguments[2], file: CommandLine.arguments[3])
|
||||
print("PASS: native TLS receiver fetches relay and acknowledges PlayerModel handoff/control/disconnect")
|
||||
|
||||
Reference in New Issue
Block a user