Merge pull request #2645 from tombaranowicz/tombaranowicz-patch-1

Disable pipController init if pictureInPicture is false
This commit is contained in:
Eran Hammer 2022-04-20 00:54:53 -07:00 committed by GitHub
commit 2dadf28bb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -907,7 +907,7 @@ static int const RCTVideoUnset = -1;
}
- (void)setupPipController {
if (!_pipController && _playerLayer && [AVPictureInPictureController isPictureInPictureSupported]) {
if (!_pipController && _playerLayer && [AVPictureInPictureController isPictureInPictureSupported] && _pictureInPicture) {
// Create new controller passing reference to the AVPlayerLayer
_pipController = [[AVPictureInPictureController alloc] initWithPlayerLayer:_playerLayer];
_pipController.delegate = self;