fix(tvos): fix build (and update sample) (#4134)

* fix(tvos): fix build (and update sample)
This commit is contained in:
Olivier Bouillet 2024-09-02 15:42:51 +02:00 committed by GitHub
parent 3a32d67087
commit 688d98d68f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 16 deletions

View File

@ -316,11 +316,11 @@ PODS:
- React-jsinspector (0.71.12-0)
- React-logger (0.71.12-0):
- glog
- react-native-video (6.0.0):
- react-native-video (6.4.5):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- react-native-video/Video (= 6.0.0)
- react-native-video/Video (6.0.0):
- react-native-video/Video (= 6.4.5)
- react-native-video/Video (6.4.5):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- React-perflogger (0.71.12-0)
@ -592,7 +592,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 0c8c5e8b2171be52295f59097923babf84d1cf66
React-jsinspector: f8e6919523047a9bd1270ade75b4eca0108963b4
React-logger: 16c56636d4209cc204d06c5ba347cee21b960012
react-native-video: fc60911540a69935cc7950829163f6f41259cb0d
react-native-video: fdcfbf66416475f8e122be9f7d72dd1d156ef3ed
React-perflogger: 355109dc9d6f34e35bc35dabb32310f8ed2d29a2
React-RCTActionSheet: 9d1be4d43972f2aae4b31d9e53ffb030115fa445
React-RCTAnimation: aab7e1ecd325db67e1f2a947d85a52adf86594b7
@ -609,6 +609,6 @@ SPEC CHECKSUMS:
Yoga: 8b8c06e142662150974d1c70b4c5ffb08eb468db
YogaKit: 1e22bf2228b3a5ac8cc88965153061ae92c494b5
PODFILE CHECKSUM: 26d254806a611a4bc6b6c39cff790dd08f770ccf
PODFILE CHECKSUM: e20830ba1d59fa52a9075c08861e37e5f2ac113c
COCOAPODS: 1.15.2

View File

@ -498,18 +498,19 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
NowPlayingInfoCenterManager.shared.registerPlayer(player: _player!)
}
} else {
if #available(iOS 16.0, *) {
// This feature caused crashes, if the app was put in bg, before the source change
// https://github.com/TheWidlarzGroup/react-native-video/issues/3900
self._playerViewController?.allowsVideoFrameAnalysis = false
}
#if !os(tvOS)
if #available(iOS 16.0, *) {
// This feature caused crashes, if the app was put in bg, before the source change
// https://github.com/TheWidlarzGroup/react-native-video/issues/3900
self._playerViewController?.allowsVideoFrameAnalysis = false
}
#endif
_player?.replaceCurrentItem(with: playerItem)
if #available(iOS 16.0, *) {
self._playerViewController?.allowsVideoFrameAnalysis = true
}
#if !os(tvOS)
if #available(iOS 16.0, *) {
self._playerViewController?.allowsVideoFrameAnalysis = true
}
#endif
// later we can just call "updateNowPlayingInfo:
NowPlayingInfoCenterManager.shared.updateNowPlayingInfo()
}