4

How can I disable Picture in Picture button/mode using Swift in iOS9 on iPad when user tries to play a video in my app?

Brian
  • 14,610
  • 7
  • 35
  • 43
Daniil Harik
  • 4,619
  • 10
  • 55
  • 60

2 Answers2

9

Default AVPlayerLayers won't use PiP unless you use an AVPictureInPictureController.

AVPlayerViewController has a property allowsPictureInPicture which you can set to false.

jtbandes
  • 115,675
  • 35
  • 233
  • 266
0

In iOS 16.4, You can hide picture-in-picture button by using below code:

We have AVPlayerViewController which has property allowsPictureInPicturePlayback and we can set it false so that the PIP Button will not show.

self.allowsPictureInPicturePlayback = false
Kudos
  • 1,224
  • 9
  • 21