Instance Method

initWithPlayerLayer:

The designated initializer for a Picture in Picture controller.

Declaration

- (instancetype)initWithPlayerLayer:(AVPlayerLayer *)playerLayer;

Parameters

playerLayer

The player layer containing the media content for the Picture in Picture controller.

Return Value

A new Picture in Picture controller, initialized with the specified player layer.

Discussion

If Picture in Picture is not supported on the current device, this method returns nil.

To ensure that PiP continues to work, do not release the returned object, whether your app is running in the foreground or background.

See Also

Creating and Configuring a Picture in Picture Controller

delegate

The delegate object for the Picture in Picture controller.

AVPictureInPictureControllerDelegate

Methods you can implement to configure your app’s user interface to respond to user interactions for Picture in Picture on iPad.

playerLayer

The AVPlayerLayer instance containing the media to play.