Reputation: 4719
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?
Upvotes: 4
Views: 8434
Reputation: 118691
Default AVPlayerLayers won't use PiP unless you use an AVPictureInPictureController.
AVPlayerViewController has a property allowsPictureInPicturePlayback
which you can set to false
.
Upvotes: 10
Reputation: 1490
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
Upvotes: 0