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:
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?
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?