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.appliesMediaSelectionCriteriaAutomatically = false
|
||||||
player.currentItem?.externalMetadata = createMetadata()
|
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 timeScale = CMTimeScale(NSEC_PER_SEC)
|
||||||
let time = CMTime(seconds: 5, preferredTimescale: timeScale)
|
let time = CMTime(seconds: 5, preferredTimescale: timeScale)
|
||||||
|
|
||||||
|
|
|
@ -89,13 +89,15 @@ struct VLCPlayerCompactOverlayView: View, VideoPlayerOverlay {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Button {
|
if !viewModel.subtitleStreams.isEmpty {
|
||||||
viewModel.playerOverlayDelegate?.didSelectCaptions()
|
Button {
|
||||||
} label: {
|
viewModel.playerOverlayDelegate?.didSelectCaptions()
|
||||||
if viewModel.subtitlesEnabled {
|
} label: {
|
||||||
Image(systemName: "captions.bubble.fill")
|
if viewModel.subtitlesEnabled {
|
||||||
} else {
|
Image(systemName: "captions.bubble.fill")
|
||||||
Image(systemName: "captions.bubble")
|
} else {
|
||||||
|
Image(systemName: "captions.bubble")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,8 +249,6 @@ struct VLCPlayerCompactOverlayView: View, VideoPlayerOverlay {
|
||||||
}
|
}
|
||||||
.frame(maxWidth: 800, maxHeight: 50)
|
.frame(maxWidth: 800, maxHeight: 50)
|
||||||
}
|
}
|
||||||
.padding(.top)
|
|
||||||
// .padding(.horizontal)
|
|
||||||
.ignoresSafeArea(edges: .top)
|
.ignoresSafeArea(edges: .top)
|
||||||
.tint(Color.white)
|
.tint(Color.white)
|
||||||
.foregroundColor(Color.white)
|
.foregroundColor(Color.white)
|
||||||
|
|
Loading…
Reference in New Issue