fix(tvos): build (#4511)

This commit is contained in:
Kamil Moskała
2025-04-14 15:47:15 +02:00
committed by GitHub
parent ab8ec0699b
commit 40340467d7
2 changed files with 14 additions and 12 deletions

View File

@@ -322,6 +322,7 @@ class RCTPlayerObserver: NSObject, AVPlayerItemMetadataOutputPushDelegate, AVPla
_restoreUserInterfaceForPIPStopCompletionHandler = completionHandler
}
#if !os(tvOS)
func playerViewController(
_: AVPlayerViewController,
willEndFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator
@@ -335,6 +336,7 @@ class RCTPlayerObserver: NSObject, AVPlayerItemMetadataOutputPushDelegate, AVPla
self.player?.play()
}
}
#endif
func setRestoreUserInterfaceForPIPStopCompletionHandler(_ restore: Bool) {
guard let _restoreUserInterfaceForPIPStopCompletionHandler else { return }

View File

@@ -1167,7 +1167,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
viewController.player = player
// Set the initial playback speed in controls to match playback rate
if #available(iOS 16.0, *) {
if #available(iOS 16.0, tvOS 16.0, *) {
if let initialSpeed = viewController.speeds.first(where: { $0.rate == _rate }) {
viewController.selectSpeed(initialSpeed)
}