mirror of
https://github.com/yattee/yattee.git
synced 2025-08-08 11:44:06 +00:00
Merge pull request #636 from stonerl/captions
fix handling and displaying captions
This commit is contained in:
@@ -312,7 +312,6 @@ struct ControlsOverlay: View {
|
||||
.foregroundColor(.primary)
|
||||
}
|
||||
.transaction { t in t.animation = .none }
|
||||
|
||||
.buttonStyle(.plain)
|
||||
.foregroundColor(.primary)
|
||||
.frame(width: 240, height: 40)
|
||||
@@ -374,12 +373,12 @@ struct ControlsOverlay: View {
|
||||
let captions = player.currentVideo?.captions ?? []
|
||||
Picker("Captions", selection: captionsBinding) {
|
||||
if captions.isEmpty {
|
||||
Text("Not available")
|
||||
Text("Not available").tag(Captions?.none)
|
||||
} else {
|
||||
Text("Disabled").tag(Captions?.none)
|
||||
}
|
||||
ForEach(captions) { caption in
|
||||
Text(caption.description).tag(Optional(caption))
|
||||
ForEach(captions) { caption in
|
||||
Text(caption.description).tag(Optional(caption))
|
||||
}
|
||||
}
|
||||
}
|
||||
.disabled(captions.isEmpty)
|
||||
|
@@ -433,12 +433,12 @@ struct PlaybackSettings: View {
|
||||
let captions = player.currentVideo?.captions ?? []
|
||||
Picker("Captions".localized(), selection: $player.captions) {
|
||||
if captions.isEmpty {
|
||||
Text("Not available")
|
||||
Text("Not available").tag(Captions?.none)
|
||||
} else {
|
||||
Text("Disabled").tag(Captions?.none)
|
||||
}
|
||||
ForEach(captions) { caption in
|
||||
Text(caption.description).tag(Optional(caption))
|
||||
ForEach(captions) { caption in
|
||||
Text(caption.description).tag(Optional(caption))
|
||||
}
|
||||
}
|
||||
}
|
||||
.disabled(captions.isEmpty)
|
||||
|
Reference in New Issue
Block a user