title: How to stop going to picture in picture when swiped up(put the application in background) and video is playing in custom AVPLayer?
body: <p>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 <code>AVPlayer</code> in my custom player and <code>AVPictureInPictureController</code> for Picture in picture support.</p>
  <p>I found a solution related <code>AVPlayerViewController</code> in which <code>.allowsPictureInPicturePlayback</code> property allows to disable picture in picture. But I  didn't find any properties for <code>AVPlayer</code> or <code>AVPlayerLayer</code> to restrict picture in picture.</p>
  <p>Please share possible solutions to handle this case. Thanks in advance.</p>