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?
Asked
Active
Viewed 7,020 times
4
-
What "default video player" are you using? – jtbandes Sep 22 '15 at 20:39
-
1Sorry for not being clear. My application runs within WKWebView and I'm referring to "default video player" as to the player that is being opened by WKWebView – Daniil Harik Sep 22 '15 at 21:15
-
That info belongs in the question. [edit] – jtbandes Sep 22 '15 at 21:50
-
If it's in WKWebView, I guess you need https://stackoverflow.com/a/54469523/276648 – user276648 Jan 02 '23 at 02:39
2 Answers
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