# IMAPictureInPictureProxy

    @interface IMAPictureInPictureProxy
        : NSProxy <AVPictureInPictureControllerDelegate,
                   AVPlayerViewControllerDelegate>

A proxy class that lets IMA SDK detect entering and exiting
Picture-in-Picture.

To use the proxy, create an instance of `IMAPictureInPictureProxy` with the
Picture-in-Picture delegate as an argument. Set the
Picture-in-Picture controller's delegate to the proxy. For details, see
[Picture in Picture](https://developers.google.com/interactive-media-ads/docs/sdks/ios/picture_in_picture).
- `


  ### [pictureInPictureActive](https://developers.google.com/interactive-media-ads/docs/sdks/tvos/client-side/reference/Classes/IMAPictureInPictureProxy#/c:objc(cs)IMAPictureInPictureProxy(py)pictureInPictureActive)


  ` Whether or not Picture-in-Picture is currently active.

  #### Declaration

  Swift

      var isPictureInPictureActive: Bool { get }

  Objective-C

      @property (nonatomic, readonly, getter=isPictureInPictureActive) BOOL pictureInPictureActive;

- `


  ### [+isPictureInPictureSupported](https://developers.google.com/interactive-media-ads/docs/sdks/tvos/client-side/reference/Classes/IMAPictureInPictureProxy#/c:objc(cs)IMAPictureInPictureProxy(cm)isPictureInPictureSupported)


  ` Whether or not Picture-in-Picture is supported on this device.

  #### Declaration

  Swift

      class func isPictureInPictureSupported() -> Bool

  Objective-C

      + (BOOL)isPictureInPictureSupported;

- `


  ### [-initWithAVPictureInPictureControllerDelegate:](https://developers.google.com/interactive-media-ads/docs/sdks/tvos/client-side/reference/Classes/IMAPictureInPictureProxy#/c:objc(cs)IMAPictureInPictureProxy(im)initWithAVPictureInPictureControllerDelegate:)


  ` Instantiates an IMAPictureInPictureProxy that will proxy delegate
  messages from an AVPictureInPictureController, and forward them
  to the AVPictureInPictureControllerDelegate passed on init.

  #### Declaration

  Swift

      init(avPictureInPictureControllerDelegate delegate: any AVPictureInPictureControllerDelegate)

  Objective-C

      - (nonnull instancetype)initWithAVPictureInPictureControllerDelegate:
          (nonnull id<AVPictureInPictureControllerDelegate>)delegate;

  #### Parameters

  |---|---|
  | ` delegate ` | the AVPictureInPictureControllerDelegate |

  #### Return Value

  an IMAPictureInPictureProxy instance
- `


  ### [-initWithAVPlayerViewControllerDelegate:](https://developers.google.com/interactive-media-ads/docs/sdks/tvos/client-side/reference/Classes/IMAPictureInPictureProxy#/c:objc(cs)IMAPictureInPictureProxy(im)initWithAVPlayerViewControllerDelegate:)


  ` Instantiates an IMAPictureInPictureProxy that will proxy delegate
  messages from an AVPlayerViewController, and forward them to the
  AVPlayerViewControllerDelegate passed on init.

  #### Declaration

  Swift

      init(avPlayerViewControllerDelegate delegate: any AVPlayerViewControllerDelegate)

  Objective-C

      - (nonnull instancetype)initWithAVPlayerViewControllerDelegate:
          (nonnull id<AVPlayerViewControllerDelegate>)delegate;

  #### Parameters

  |---|---|
  | ` delegate ` | the AVPlayerViewControllerDelegate |

  #### Return Value

  an IMAPictureInPictureProxy instance