Contents

playerViewController(_:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:)

Tells the delegate when Picture in Picture is about to stop so you can restore your app’s user interface.

Declaration

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

Parameters

  • playerViewController:

    The player view controller.

  • completionHandler:

    You must call the completion handler with a value of true to allow the system to finish restoring your app’s user interface.

Mentioned in

Discussion

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

Responding to Picture in Picture Life Cycle Events