[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
|
#else
|
||||||
|
|
||||||
PreferenceUIHostingControllerView {
|
|
||||||
Group {
|
|
||||||
if Defaults[.VideoPlayer.videoPlayerType] == .swiftfin {
|
if Defaults[.VideoPlayer.videoPlayerType] == .swiftfin {
|
||||||
|
PreferenceUIHostingControllerView {
|
||||||
VideoPlayer(manager: self.videoPlayerManager)
|
VideoPlayer(manager: self.videoPlayerManager)
|
||||||
|
}
|
||||||
|
.ignoresSafeArea()
|
||||||
} else {
|
} else {
|
||||||
NativeVideoPlayer(manager: self.videoPlayerManager)
|
NativeVideoPlayer(manager: self.videoPlayerManager)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
.ignoresSafeArea()
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,8 @@ struct NativeVideoPlayerView: UIViewControllerRepresentable {
|
|||||||
func updateUIViewController(_ uiViewController: UINativeVideoPlayerViewController, context: Context) {}
|
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 {
|
class UINativeVideoPlayerViewController: AVPlayerViewController {
|
||||||
|
|
||||||
let videoPlayerManager: VideoPlayerManager
|
let videoPlayerManager: VideoPlayerManager
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user