Merge pull request #2971 from somersets/fix/ios_crash_presentFullScreenPlayer
Fix(ios): crash present full screen player
This commit is contained in:
commit
5b0fd0e585
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
### Version 6.0.0-alpha.4
|
### Version 6.0.0-alpha.4
|
||||||
|
|
||||||
|
- Fix: iOS app crashes on call to presentFullScreenPlayer [#2808](https://github.com/react-native-video/react-native-video/pull/2971)
|
||||||
- ensure src is always provided to native player even if it is invalid [#2857](https://github.com/react-native-video/react-native-video/pull/2857)
|
- ensure src is always provided to native player even if it is invalid [#2857](https://github.com/react-native-video/react-native-video/pull/2857)
|
||||||
- Sample: Add react-native-video controls support [#2852](https://github.com/react-native-video/react-native-video/pull/2852)
|
- Sample: Add react-native-video controls support [#2852](https://github.com/react-native-video/react-native-video/pull/2852)
|
||||||
- Android: Switch Google's maven repository to default `google()` [#2860](https://github.com/react-native-video/react-native-video/pull/2860)
|
- Android: Switch Google's maven repository to default `google()` [#2860](https://github.com/react-native-video/react-native-video/pull/2860)
|
||||||
|
@ -324,7 +324,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
"target": self.reactTag
|
"target": self.reactTag
|
||||||
])
|
])
|
||||||
}.catch{_ in }
|
}.catch{_ in }
|
||||||
_videoLoadStarted = true
|
self._videoLoadStarted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,7 +635,8 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
|
|
||||||
self.onVideoFullscreenPlayerWillPresent?(["target": reactTag as Any])
|
self.onVideoFullscreenPlayerWillPresent?(["target": reactTag as Any])
|
||||||
|
|
||||||
viewController.present(viewController, animated:true, completion:{
|
if let playerViewController = _playerViewController {
|
||||||
|
viewController.present(playerViewController, animated:true, completion:{
|
||||||
self._playerViewController?.showsPlaybackControls = true
|
self._playerViewController?.showsPlaybackControls = true
|
||||||
self._fullscreenPlayerPresented = fullscreen
|
self._fullscreenPlayerPresented = fullscreen
|
||||||
self._playerViewController?.autorotate = self._fullscreenAutorotate
|
self._playerViewController?.autorotate = self._fullscreenAutorotate
|
||||||
@ -644,6 +645,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if !fullscreen && _fullscreenPlayerPresented, let _playerViewController = _playerViewController {
|
} else if !fullscreen && _fullscreenPlayerPresented, let _playerViewController = _playerViewController {
|
||||||
self.videoPlayerViewControllerWillDismiss(playerViewController: _playerViewController)
|
self.videoPlayerViewControllerWillDismiss(playerViewController: _playerViewController)
|
||||||
_presentingViewController?.dismiss(animated: true, completion:{
|
_presentingViewController?.dismiss(animated: true, completion:{
|
||||||
|
Loading…
Reference in New Issue
Block a user