[tvOS][QOL] Supports back button click when in the native player. (#947)
This commit is contained in:
parent
9434a08a14
commit
3b59bed413
|
@ -46,18 +46,14 @@ final class VideoPlayerCoordinator: NavigationCoordinatable {
|
|||
}
|
||||
|
||||
#else
|
||||
|
||||
PreferenceUIHostingControllerView {
|
||||
Group {
|
||||
if Defaults[.VideoPlayer.videoPlayerType] == .swiftfin {
|
||||
VideoPlayer(manager: self.videoPlayerManager)
|
||||
} else {
|
||||
NativeVideoPlayer(manager: self.videoPlayerManager)
|
||||
}
|
||||
if Defaults[.VideoPlayer.videoPlayerType] == .swiftfin {
|
||||
PreferenceUIHostingControllerView {
|
||||
VideoPlayer(manager: self.videoPlayerManager)
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
} else {
|
||||
NativeVideoPlayer(manager: self.videoPlayerManager)
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ struct NativeVideoPlayerView: UIViewControllerRepresentable {
|
|||
func updateUIViewController(_ uiViewController: UINativeVideoPlayerViewController, context: Context) {}
|
||||
}
|
||||
|
||||
// TODO: Refactor such that this does not subclass AVPlayerViewController. Subclassing is not
|
||||
// supported according to the apple docs.
|
||||
class UINativeVideoPlayerViewController: AVPlayerViewController {
|
||||
|
||||
let videoPlayerManager: VideoPlayerManager
|
||||
|
|
Loading…
Reference in New Issue