Skip to content
Snippets Groups Projects

Hide PiP button if is not unavailable

Open Mohamed Sliem requested to merge Sliem/vlc-ios:disable-pip into master
1 unresolved thread

This should fix #1879

Merge request reports

Members who can merge are allowed to add commits.

Merge request pipeline #567289 passed

Merge request pipeline passed for db7de456

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • 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ühne
    • Author Contributor

      My bad! I forgot and depended on the supported version of iOS only, excluding the iPad. I know this AVPictureInPictureController attribute, but I thought using anything related to AVKit was unacceptable. I will implement the solution you mentioned above.

    • This 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 is true but the system always set isPictureInPicturePossible to false, 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

    • Author Contributor

      I believe these values for iOS could differ, even though this should be a temporary solution for monitoring PiP availability until VLCKit offers an interface to observe the PiP availability state.

    • @umxprime does this need to be part of VLCKit/libvlc and not just the UI?

    • Please register or sign in to reply
Please register or sign in to reply
Loading