Closed defagos closed 2 years ago
The opt-in setting has been implemented on the feature/pip-opt-in
branch. The flag can be toggled at any time and the behavior will be adjusted automatically (e.g. an SRGPictureInPictureButton
will automatically appear or disappear).
I applied the new opt-in to the advanced demo, which is the only custom player with PiP support in our demo project. I also updated the code to deal with the special case of using SRGMediaPlayerViewControler
, as well as the associated documentation.
Not sure when (and if) this behavior changed with iOS 14 and the introduction of PiP for iPhone, but PiP should now be an opt-in. If we namely play a video with
SRGMediaPlayerController
and anSRGMediaPlayerView
, playback will automatically switch to PiP when sending the app to the background, whether or not a PiP delegate was actually implemented by the application.This is of course due to the fact that we currently always instantiate a PiP controller when we can. This process itself should be an opt-in, so that PiP only occurs where the app decides it has to.
Issue type
Incorrect behavior
Environment information
Reproducibility
Always reproducible
Steps to reproduce