D.Khan D.Khan - 2 months ago 12
Objective-C Question

Objective-C: How to use AVPictureInPictureController

I am trying to set up picture in picture for my iPad app and I have a custom video player so I am following the sample code from: https://developer.apple.com/library/ios/samplecode/AVFoundationPiPPlayer/Introduction/Intro.html

I am implementing this in Objective-C and the second line of code below gives the error that "Property isPictureInPictureSupported not found on object of type AVPictureInPictureController.

AVPictureInPictureController *controller = [[AVPictureInPictureController alloc]init];

if (controller.isPictureInPictureSupported) {


isPictureInPictureSupported is a class method on AVPictureInPictureController, not an instance property. So you call it like this:

if ([AVPictureInPictureController isPictureInPictureSupported]) {