PlayerPictureInPicturePlayableDelegate

public protocol PlayerPictureInPicturePlayableDelegate

The player picture in picture delegate

  • Called on start of PiP

    Declaration

    Swift

    @available(tvOS 14.0, *)
    func playerDidStartPictureInPicture()
  • Called on Stop of PiP

    Declaration

    Swift

    @available(tvOS 14.0, *)
    func playerDidStopPictureInPicture()
  • Called on PiP failure

    Declaration

    Swift

    @available(tvOS 14.0, *)
    func playerDidFailToStartPictureInPicture(with error: Error)

    Parameters

    error

    error resulted in failure of PiP

  • 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.

    Declaration

    Swift

    @available(tvOS 14.0, *)
    func restoreUserInterfaceForPictureInPictureStopWithCompletionHandler(completionHandler: @escaping (Bool) -> Void)

    Parameters

    completionHandler

    The completion handler. To allow the system to finish restoring your user interface, you must call the completion handler with a value of true.