diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 325a06f1..bd1a916e 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -488,8 +488,18 @@ 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 + } + _player?.replaceCurrentItem(with: playerItem) + if #available(iOS 16.0, *) { + self._playerViewController?.allowsVideoFrameAnalysis = true + } + // later we can just call "updateNowPlayingInfo: NowPlayingInfoCenterManager.shared.updateNowPlayingInfo() }