feat: select Miruro playback and caption providers
This commit is contained in:
@@ -171,6 +171,41 @@ struct PlayerQualityMenu: View {
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
struct PlayerMiruroMenu: View {
|
||||
@ObservedObject var model: PlayerModel
|
||||
|
||||
var body: some View {
|
||||
if !model.miruroVideoProviders.isEmpty {
|
||||
Menu("Miruro") {
|
||||
Menu("Video Host") {
|
||||
Button(model.miruroVideoProvider.isEmpty ? "✓ Automatic" : "Automatic") {
|
||||
model.setMiruroVideoProvider("")
|
||||
}
|
||||
ForEach(model.miruroVideoProviders, id: \.self) { provider in
|
||||
Button(model.miruroVideoProvider == provider ? "✓ \(provider)" : provider) {
|
||||
model.setMiruroVideoProvider(provider)
|
||||
}
|
||||
}
|
||||
Text("Current: \(model.selectedMiruroVideoProvider ?? "None")")
|
||||
}
|
||||
Menu("Caption Provider") {
|
||||
Button(model.miruroCaptionProvider.isEmpty ? "✓ Automatic" : "Automatic") {
|
||||
model.setMiruroCaptionProvider("")
|
||||
}
|
||||
ForEach(model.miruroCaptionProviders, id: \.self) { provider in
|
||||
Button(model.miruroCaptionProvider == provider ? "✓ \(provider)" : provider) {
|
||||
model.setMiruroCaptionProvider(provider)
|
||||
}
|
||||
}
|
||||
Text("Current: \(model.selectedMiruroCaptionProvider ?? "None")")
|
||||
}
|
||||
}
|
||||
.disabled(!model.canChangeMiruroProvider)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
struct PlayerCommands: Commands {
|
||||
@FocusedObject private var focusedModel: PlayerModel?
|
||||
@@ -275,6 +310,7 @@ struct PlayerCommands: Commands {
|
||||
Text(model.youtubeHeight.map { "Current: \($0)p" } ?? "Current resolution unknown")
|
||||
}
|
||||
}
|
||||
PlayerMiruroMenu(model: model).disabled(!hasFocusedScene)
|
||||
Button(model.showsBufferInfo ? "Hide Buffer Info" : "Show Buffer Info") {
|
||||
model.performMenuAction(bufferInfo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user