mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Add Welcome screen
This commit is contained in:
@@ -139,7 +139,7 @@ struct PlaybackBar: View {
|
||||
}
|
||||
|
||||
private func availableStreamsForInstance(_ instance: Instance) -> [Stream.Kind: [Stream]] {
|
||||
let streams = player.availableStreams.filter { $0.instance == instance }.sorted(by: player.streamsSorter)
|
||||
let streams = player.availableStreamsSorted.filter { $0.instance == instance }
|
||||
|
||||
return Dictionary(grouping: streams, by: \.kind!)
|
||||
}
|
||||
|
@@ -36,17 +36,23 @@ struct Player: UIViewControllerRepresentable {
|
||||
#if os(tvOS)
|
||||
var streamingQualityMenu: UIMenu {
|
||||
UIMenu(
|
||||
title: "Streaming quality",
|
||||
title: "Streams",
|
||||
image: UIImage(systemName: "antenna.radiowaves.left.and.right"),
|
||||
children: streamingQualityMenuActions
|
||||
)
|
||||
}
|
||||
|
||||
var streamingQualityMenuActions: [UIAction] {
|
||||
player.availableStreamsSorted.map { stream in
|
||||
let image = player.streamSelection == stream ? UIImage(systemName: "checkmark") : nil
|
||||
guard !player.availableStreams.isEmpty else {
|
||||
return [ // swiftlint:disable:this implicit_return
|
||||
UIAction(title: "Empty", attributes: .disabled) { _ in }
|
||||
]
|
||||
}
|
||||
|
||||
return UIAction(title: stream.description, image: image) { _ in
|
||||
return player.availableStreamsSorted.map { stream in
|
||||
let state = player.streamSelection == stream ? UIAction.State.on : .off
|
||||
|
||||
return UIAction(title: stream.description, state: state) { _ in
|
||||
self.player.streamSelection = stream
|
||||
self.player.upgradeToStream(stream)
|
||||
}
|
||||
|
Reference in New Issue
Block a user