mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Bring AVPlayer back to tvOS
This commit is contained in:
@@ -60,7 +60,7 @@ struct StreamControl: View {
|
||||
.frame(maxWidth: 320)
|
||||
}
|
||||
.contextMenu {
|
||||
ForEach(player.availableStreamsSorted) { stream in
|
||||
ForEach(streams) { stream in
|
||||
Button(stream.description) { player.streamSelection = stream }
|
||||
}
|
||||
|
||||
@@ -79,10 +79,14 @@ struct StreamControl: View {
|
||||
}
|
||||
|
||||
private func availableStreamsForInstance(_ instance: Instance) -> [Stream.Kind: [Stream]] {
|
||||
let streams = player.availableStreamsSorted.filter { $0.instance == instance }.filter { player.backend.canPlay($0) }
|
||||
let streams = streams.filter { $0.instance == instance }.filter { player.backend.canPlay($0) }
|
||||
|
||||
return Dictionary(grouping: streams, by: \.kind!)
|
||||
}
|
||||
|
||||
var streams: [Stream] {
|
||||
player.availableStreamsSorted.filter { player.backend.canPlay($0) }
|
||||
}
|
||||
}
|
||||
|
||||
struct StreamControl_Previews: PreviewProvider {
|
||||
|
Reference in New Issue
Block a user