I am working on a video player which supports Picture in picture.
I play ads and video content on that player. I want to restrict automatic picture in picture when swiped up(put the app in the background) from the device when the player is playing ads. And once the ad is completed, I want to allow it to go picture in picture whenever the app goes into the background.
I am using AVPlayer in my custom player and AVPictureInPictureController for Picture in picture support.
I found a solution related AVPlayerViewController in which .allowsPictureInPicturePlayback property allows to disable picture in picture. But I didn't find any properties for AVPlayer or AVPlayerLayer to restrict picture in picture.
Please share possible solutions to handle this case. Thanks in advance.