Hide PiP button if is not unavailable
This should fix #1879
Merge request reports
Activity
This is not the good fix. PiP was introduced in iOS 9, so we must enable it on previous releases. However, we should not show the button in the audio player at all and there are scenarios where PiP is unavailable (as determined by the OS). There is a high level API to check for the availability and we should use it (
AVPictureInPictureController.isPictureInPictureSupported
).Note that during the lifetime of the app, the value of the above API change (for instance if another app stops PiP playback or a screen is connected/disconnected), so it should be checked every time the video player interface newly appears.
Edited by Felix Paul KühneThis is a bit more convoluted than simply checking the
AVPictureInPictureController.isPictureInPictureSupported
value.
isPictureInPictureSupported
is there to know if the device (not the system) is supporting PiP.
There's also this isPictureInPicturePossible that has to be observed constantly to know if the system allows the use of PiP.
As an example with these APIs, as much as I've tested on macOS,isPictureInPictureSupported
istrue
but the system always setisPictureInPicturePossible
tofalse
, that's why we chose to use the PiP private APIs on that platform.
libvlc probably needs a bit more work to handle that situation properly, and IMHO it should be the VLCKit responsibility to provide the proper interface to figure out if PiP is supported/possible@umxprime does this need to be part of VLCKit/libvlc and not just the UI?