Cleanup and hide subtitle button if there is none
This commit is contained in:
parent
f1612a0e30
commit
6712ef279d
|
@ -29,14 +29,6 @@ class NativePlayerViewController: AVPlayerViewController {
|
|||
player.appliesMediaSelectionCriteriaAutomatically = false
|
||||
player.currentItem?.externalMetadata = createMetadata()
|
||||
|
||||
let chevron = UIImage(systemName: "chevron.right.circle.fill")!
|
||||
let testAction = UIAction(title: "Next", image: chevron) { action in
|
||||
print("next item selected")
|
||||
}
|
||||
|
||||
// tvos
|
||||
// self.transportBarCustomMenuItems = [testAction]
|
||||
|
||||
let timeScale = CMTimeScale(NSEC_PER_SEC)
|
||||
let time = CMTime(seconds: 5, preferredTimescale: timeScale)
|
||||
|
||||
|
|
|
@ -89,13 +89,15 @@ struct VLCPlayerCompactOverlayView: View, VideoPlayerOverlay {
|
|||
// }
|
||||
// }
|
||||
|
||||
Button {
|
||||
viewModel.playerOverlayDelegate?.didSelectCaptions()
|
||||
} label: {
|
||||
if viewModel.subtitlesEnabled {
|
||||
Image(systemName: "captions.bubble.fill")
|
||||
} else {
|
||||
Image(systemName: "captions.bubble")
|
||||
if !viewModel.subtitleStreams.isEmpty {
|
||||
Button {
|
||||
viewModel.playerOverlayDelegate?.didSelectCaptions()
|
||||
} label: {
|
||||
if viewModel.subtitlesEnabled {
|
||||
Image(systemName: "captions.bubble.fill")
|
||||
} else {
|
||||
Image(systemName: "captions.bubble")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -247,8 +249,6 @@ struct VLCPlayerCompactOverlayView: View, VideoPlayerOverlay {
|
|||
}
|
||||
.frame(maxWidth: 800, maxHeight: 50)
|
||||
}
|
||||
.padding(.top)
|
||||
// .padding(.horizontal)
|
||||
.ignoresSafeArea(edges: .top)
|
||||
.tint(Color.white)
|
||||
.foregroundColor(Color.white)
|
||||
|
|
Loading…
Reference in New Issue