<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVKit"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPictureInPictureController"
  },
  "title" : "AVPictureInPictureController"
}
-->

# AVPictureInPictureController

A controller that responds to user-initiated Picture in Picture playback of video in a floating, resizable window.

```
class AVPictureInPictureController
```

## Overview

To use Picture in Picture, you need to configure your app to support background audio playback. See <doc://com.apple.documentation/documentation/AVFoundation/configuring-your-app-for-media-playback> for more details.

Before presenting a user interface to start Picture in Picture, call the [`isPictureInPictureSupported()`](/documentation/AVKit/AVPictureInPictureController/isPictureInPictureSupported()) method to determine if the current device supports the feature, and check the [`isPictureInPicturePossible`](/documentation/AVKit/AVPictureInPictureController/isPictureInPicturePossible) property value to determine whether PiP is possible in the current context.

> Important:
> The framework doesn’t support subclassing ``doc://com.apple.avkit/documentation/AVKit/AVPictureInPictureController``.

## Topics

### Creating a Controller

[`init(contentSource:)`](/documentation/AVKit/AVPictureInPictureController/init(contentSource:))

Creates a Picture in Picture controller with a content source.

[`init(playerLayer:)`](/documentation/AVKit/AVPictureInPictureController/init(playerLayer:))

Creates a Picture in Picture controller with a player layer.

### Configuring the Content Source

[`contentSource`](/documentation/AVKit/AVPictureInPictureController/contentSource-swift.property)

The source of the controller’s content.

[`AVPictureInPictureController.ContentSource`](/documentation/AVKit/AVPictureInPictureController/ContentSource-swift.class)

An object that represents the source of the content to present in Picture in Picture.

### Accessing the Player Layer

[`playerLayer`](/documentation/AVKit/AVPictureInPictureController/playerLayer)

The layer that displays the video content.

### Configuring Playback Behavior

[`requiresLinearPlayback`](/documentation/AVKit/AVPictureInPictureController/requiresLinearPlayback)

A Boolean value that determines whether the controller allows the user to skip media content.

### Accessing the Delegate Object

[`delegate`](/documentation/AVKit/AVPictureInPictureController/delegate)

A delegate object for a Picture in Picture controller.

[`AVPictureInPictureControllerDelegate`](/documentation/AVKit/AVPictureInPictureControllerDelegate)

A protocol to adopt to respond to Picture in Picture events.

### Accessing Picture in Picture State

[`isPictureInPictureSupported()`](/documentation/AVKit/AVPictureInPictureController/isPictureInPictureSupported())

Returns a Boolean value that indicates whether the current device supports Picture in Picture.

[`isPictureInPicturePossible`](/documentation/AVKit/AVPictureInPictureController/isPictureInPicturePossible)

A Boolean value that indicates whether Picture in Picture playback is currently possible.

[`isPictureInPictureActive`](/documentation/AVKit/AVPictureInPictureController/isPictureInPictureActive)

A Boolean value that indicates whether the Picture in Picture window is onscreen.

[`isPictureInPictureSuspended`](/documentation/AVKit/AVPictureInPictureController/isPictureInPictureSuspended)

A Boolean value that indicates whether the system suspends the controller’s Picture in Picture window.

### Controlling Picture in Picture Playback

[`canStopPictureInPicture`](/documentation/AVKit/AVPictureInPictureController/canStopPictureInPicture)

A Boolean value that indicates whether Picture in Picture is active and is able to stop.

[`canStartPictureInPictureAutomaticallyFromInline`](/documentation/AVKit/AVPictureInPictureController/canStartPictureInPictureAutomaticallyFromInline)

A Boolean value that indicates whether Picture in Picture starts automatically when the controller embeds its content inline and the app transitions to the background.

[`startPictureInPicture()`](/documentation/AVKit/AVPictureInPictureController/startPictureInPicture())

Starts Picture in Picture, if possible.

[`stopPictureInPicture()`](/documentation/AVKit/AVPictureInPictureController/stopPictureInPicture())

Stops Picture in Picture, if active.

[`invalidatePlaybackState()`](/documentation/AVKit/AVPictureInPictureController/invalidatePlaybackState())

Invalidates the controller’s current playback state and fetches the updated state from the sample buffer playback delegate object.

### Retrieving Picture in Picture Template Images

[`pictureInPictureButtonStartImage`](/documentation/AVKit/AVPictureInPictureController/pictureInPictureButtonStartImage)

A system-default template image for the button that starts Picture in Picture in your app.

[`pictureInPictureButtonStopImage`](/documentation/AVKit/AVPictureInPictureController/pictureInPictureButtonStopImage)

A system-default template image for the button that stops Picture in Picture in your app.

[`pictureInPictureButtonStartImage(compatibleWith:)`](/documentation/AVKit/AVPictureInPictureController/pictureInPictureButtonStartImage(compatibleWith:))

Returns a system-default template image that’s compatible with a trait collection for the button that starts Picture in Picture in your app.

[`pictureInPictureButtonStopImage(compatibleWith:)`](/documentation/AVKit/AVPictureInPictureController/pictureInPictureButtonStopImage(compatibleWith:))

Returns a system-default template image that’s compatible with a trait collection for the button that stops Picture in Picture in your app.



---

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)