Merge remote-tracking branch 'official/master'

This commit is contained in:
Yavor Ivanov
2023-02-08 09:47:30 +02:00
2 changed files with 10 additions and 15 deletions

View File

@@ -630,7 +630,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
func setFullscreen(_ fullscreen:Bool) {
if fullscreen && !_fullscreenPlayerPresented && _player != nil {
// Ensure player view controller is not null
if _playerViewController == nil {
if _playerViewController == nil && _controls {
self.usePlayerViewController()
}
@@ -654,7 +654,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
if let playerViewController = _playerViewController {
viewController.present(playerViewController, animated:true, completion:{
self._playerViewController?.showsPlaybackControls = true
self._playerViewController?.showsPlaybackControls = self._controls
self._fullscreenPlayerPresented = fullscreen
self._playerViewController?.autorotate = self._fullscreenAutorotate
@@ -710,7 +710,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
func createPlayerViewController(player:AVPlayer, withPlayerItem playerItem:AVPlayerItem) -> RCTVideoPlayerViewController {
let viewController = RCTVideoPlayerViewController()
viewController.showsPlaybackControls = true
viewController.showsPlaybackControls = self._controls
viewController.rctDelegate = self
viewController.preferredOrientation = _fullscreenOrientation
@@ -852,12 +852,6 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
// MARK: - React View Management
func insertReactSubview(view:UIView!, atIndex:Int) {
// We are early in the game and somebody wants to set a subview.
// That can only be in the context of playerViewController.
if !_controls && (_playerLayer == nil) && (_playerViewController == nil) {
setControls(true)
}
if _controls {
view.frame = self.bounds
_playerViewController?.contentOverlayView?.insertSubview(view, at:atIndex)