fix crash on source change, if the app was put in bg beforehand (#4074)
This commit is contained in:
parent
0a1085ce03
commit
b05201a9fa
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user