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

# init(contentSource:)

Creates a Picture in Picture controller with a content source.

```
init(contentSource: AVPictureInPictureController.ContentSource)
```

## Parameters

`contentSource`

The source of the content to show in a Picture in Picture window.

## Discussion

Use this initializer to create a controller that displays its content in a player layer or a sample buffer display layer.

> Important:
> Before attempting to create a controller, 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)