Initializer

init(playerLayer:)

The designated initializer for a Picture in Picture controller.

Declaration

init?(playerLayer: AVPlayerLayer)

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

var delegate: AVPictureInPictureControllerDelegate?

The delegate object for the Picture in Picture controller.

protocol AVPictureInPictureControllerDelegate

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

var playerLayer: AVPlayerLayer

The AVPlayerLayer instance containing the media to play.