Daniil Harik
Daniil Harik

Reputation: 4719

How to disable Picture in Picture mode for default video player

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

Answers (2)

jtbandes
jtbandes

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

Kudos
Kudos

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

Related Questions