I have followed Apple's steps in order to get my AVPlayerViewController
to support in-app and background Picture in Picture playback.
func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) {
present(playerViewController, animated: true) {
completionHandler(false)
}
}
The button shows on iPad, but not on iPhone, and video playback does not continue when going to the home screen.