<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVKit",
  "identifier" : "/documentation/AVKit/AVPictureInPictureController/init(playerLayer:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVKit"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPictureInPictureController(im)initWithPlayerLayer:"
  },
  "title" : "init(playerLayer:)"
}
-->

# init(playerLayer:)

Creates a Picture in Picture controller with a player layer.

```
convenience init?(playerLayer: AVPlayerLayer)
```

## Parameters

`playerLayer`

The player layer from which to source the media content for the Picture in Picture controller.

## Discussion

For Picture in Picture to work correctly, maintain a strong reference to this object whether your app is running in the foreground or background.

> Important:
> Before attempting to create a controller instance, verify that the current device supports Picture in Picture by calling the ``doc://com.apple.avkit/documentation/AVKit/AVPictureInPictureController/isPictureInPictureSupported()`` class method. Attempting to create a Picture in Picture controller on an unsupported device returns `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)