Instance Method

playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:

Gives your app an opportunity to restore its movie playback user interface; called when Picture in Picture is about to stop.

Declaration

- (void)playerViewController:(AVPlayerViewController *)playerViewController restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:(void (^)(BOOL restored))completionHandler;

Parameters

playerViewController

The player view controller to which you’ve assigned the delegate.

completionHandler

For the user interface to be restored, you must implement your method to return a value of YES in this block.

Discussion

Implement this method to reestablish your movie playback user interface when PiP ends. This method is called no matter how PiP ends, whether it is 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 UI for Picture in Picture

- playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart:

Allows you to opt out from the player view controller automatically dismissing when Picture in Picture (PiP) starts.