Implementing Picture in Picture on iPhone in iOS 14

I thought this would be a no brainer and automatically work when AVPlayerViewController was implemented.

Here is the implementation of AVPlayerViewController on iPad and Picture in Picture works perfectly:

Code Block
- (void)finishCellSelectVideo:(id)videoPath {
    NSURL *videoURL = [[NSURL alloc] initFileURLWithPath:videoPath];
    AVPlayer *videoPlayer = [AVPlayer playerWithURL:videoURL];
    videoPlayer.allowsExternalPlayback = YES;
    AVPlayerViewController *videoPlayerViewController = [AVPlayerViewController new];
    videoPlayerViewController.delegate = self;
    videoPlayerViewController.player = videoPlayer;
   [self presentViewController:videoPlayerViewController animated:YES completion:nil];
  
    [videoPlayer play];
}

However, with this same code Picture in Picture doesn't work on the iPhone in iOS 14. Does this code only work on iPad? Any clues as to what I am doing wrong with the iPhone code?



Replies

Same problem here.
Same code works on iPad device&simulator, but on iPhone device&simulator 'isPictureInPicturePossible' returns false.
Same iOS 14 iPhone 11 Netflix PiP works just fine.
Im having the same issue, isPictureInPicturePossible always returns false in all iOS 14 simulators. Im using Xcode 12.0.1

Same here, any solution