Instance Method


Tells the delegate that Picture in Picture is about to stop and you should restore your user interface.


optional func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void)



The player view controller.


To restore the user interface, call this completion handler with a value of true.


Implement this method to reestablish your playback user interface when PiP ends. The framework calls this method no matter how PiP ends, whether it’s because the user ended playback, the user tapped the button to return ongoing video playback to your app, or the video finished playing on its own.

See Also

Managing Your App’s Picture in Picture Behavior

func playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart(AVPlayerViewController) -> Bool

Asks the delegate whether the player view controller should automatically dismiss when Picture in Picture starts.