mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
improvements to captions on tvOS
This commit is contained in:
@@ -384,13 +384,16 @@ struct PlaybackSettings: View {
|
||||
}
|
||||
|
||||
@ViewBuilder private var captionsButton: some View {
|
||||
let videoCaptions = player.currentVideo?.captions
|
||||
#if os(macOS)
|
||||
captionsPicker
|
||||
.labelsHidden()
|
||||
.frame(maxWidth: 300)
|
||||
#elseif os(iOS)
|
||||
Menu {
|
||||
captionsPicker
|
||||
if videoCaptions?.isEmpty == false {
|
||||
captionsPicker
|
||||
}
|
||||
} label: {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "text.bubble")
|
||||
@@ -399,10 +402,17 @@ struct PlaybackSettings: View {
|
||||
{
|
||||
Text("\(language.description.capitalized) (\(language.rawValue))")
|
||||
.foregroundColor(.accentColor)
|
||||
} else {
|
||||
if videoCaptions?.isEmpty == true {
|
||||
Text("Not available")
|
||||
} else {
|
||||
Text("Disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(alignment: .trailing)
|
||||
.frame(height: 40)
|
||||
.disabled(videoCaptions?.isEmpty == true)
|
||||
}
|
||||
.transaction { t in t.animation = .none }
|
||||
.buttonStyle(.plain)
|
||||
|
Reference in New Issue
Block a user