diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 769baba7..9bcf237a 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -635,14 +635,16 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH self.onVideoFullscreenPlayerWillPresent?(["target": reactTag as Any]) - viewController.present(viewController, animated:true, completion:{ - self._playerViewController?.showsPlaybackControls = true - self._fullscreenPlayerPresented = fullscreen - self._playerViewController?.autorotate = self._fullscreenAutorotate + if let playerViewController = _playerViewController { + viewController.present(playerViewController, animated:true, completion:{ + self._playerViewController?.showsPlaybackControls = true + self._fullscreenPlayerPresented = fullscreen + self._playerViewController?.autorotate = self._fullscreenAutorotate - self.onVideoFullscreenPlayerDidPresent?(["target": self.reactTag]) + self.onVideoFullscreenPlayerDidPresent?(["target": self.reactTag]) - }) + }) + } } } else if !fullscreen && _fullscreenPlayerPresented, let _playerViewController = _playerViewController { self.videoPlayerViewControllerWillDismiss(playerViewController: _playerViewController)