Skip to content

Commit

Permalink
Only setup pip if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
anderslemke committed Apr 20, 2022
1 parent 0883f0a commit 48f524c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ - (void)setRestoreUserInterfaceForPIPStopCompletionHandler:(BOOL)restore
}

- (void)setupPipController {
if (!_pipController && _playerLayer && [AVPictureInPictureController isPictureInPictureSupported] && _pictureInPicture) {
if (_pictureInPicture && !_pipController && _playerLayer && [AVPictureInPictureController isPictureInPictureSupported]) {
// Create new controller passing reference to the AVPlayerLayer
_pipController = [[AVPictureInPictureController alloc] initWithPlayerLayer:_playerLayer];
_pipController.delegate = self;
Expand Down

0 comments on commit 48f524c

Please sign in to comment.