Instance Method

startPictureInPicture()

Starts Picture in Picture for the associated AVPlayerLayer instance, if possible.

Declaration

func startPictureInPicture()

Discussion

When you call this method and Picture in Picture (PiP) is possible, your delegate receives a call to the pictureInPictureControllerWillStartPictureInPicture(_:) method. After a successful start, your delegate receives a call to the pictureInPictureControllerDidStartPictureInPicture(_:) method.

If PiP fails, your delegate receives a call to the pictureInPictureControllerFailedToStartPictureInPicture:withError: method.

Whether you explicitly stop PiP, the user stops it through interaction, or the system stops it, your delegate receives a call to the pictureInPictureControllerWillStopPictureInPicture(_:) method, followed by the pictureInPictureControllerDidStopPictureInPicture(_:) method after the PiP stop animation completes.

See Also

Controlling Picture in Picture Playback

func stopPictureInPicture()

Stops Picture in Picture for the associated AVPlayerLayer instance, if it is currently active.