fix: issue 3040, prevent crash
This commit is contained in:
parent
12d7dd6d8b
commit
d526479fe0
@ -665,6 +665,11 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
self.onVideoFullscreenPlayerWillPresent?(["target": reactTag as Any])
|
self.onVideoFullscreenPlayerWillPresent?(["target": reactTag as Any])
|
||||||
|
|
||||||
if let playerViewController = _playerViewController {
|
if let playerViewController = _playerViewController {
|
||||||
|
if(_controls) {
|
||||||
|
// prevents crash https://github.com/react-native-video/react-native-video/issues/3040
|
||||||
|
self._playerViewController?.removeFromParent()
|
||||||
|
}
|
||||||
|
|
||||||
viewController.present(playerViewController, animated:true, completion:{
|
viewController.present(playerViewController, animated:true, completion:{
|
||||||
self._playerViewController?.showsPlaybackControls = self._controls
|
self._playerViewController?.showsPlaybackControls = self._controls
|
||||||
self._fullscreenPlayerPresented = fullscreen
|
self._fullscreenPlayerPresented = fullscreen
|
||||||
|
Loading…
Reference in New Issue
Block a user