Closed defagos closed 4 years ago
I had a rough time understanding why this was not working, while it was working in other projects based on SRG Media Player perfectly fine (e.g. Letterbox or Play). The fact that AVPlayerViewController
-based examples were working fine in the SRG Media Player demo was also proof it was not an OS or device issue.
The implementation of PiP in the demo is in fact perfectly fine. What is not is the that the modal presentation is made using standard iOS presentation animations, internally implemented using UIPercentDrivenInteractiveTransition
. Such transitions mess with timeOffset
, thus altering the time of the player, even pausing it sometimes.
AVPlayerViewController
works fine because it uses its own private transitioning delegate (AVTransitionController
).
I therefore updated the advanced player example to use the modal transition we had on the segment player example. I removed it from this less interesting example.
I also updated SRGMediaPlayerController
header picture in picture documentation to mention this fact.
I updated the advanced player demo with a very basic control center implementation. This provides an example to start from, as well as a valuable tool to test picture in picture vs. AirPlay interactions.
When returning from picture in picture, restoration occurs erratically. Sometimes it works, sometimes it interrupts playback, sometimes the animation is ugly.
Issue type
Incorrect behavior
Environment information
Reproducibility
Always reproducible
Steps to reproduce