SRGSSR / pillarbox-apple

A next-generation reactive media playback ecosystem for Apple platforms.
https://testflight.apple.com/join/TS6ngLqf
MIT License
60 stars 9 forks source link

Issue with video layer display when Picture in Picture is enabled for several views at the same time #1005

Closed defagos closed 2 months ago

defagos commented 2 months ago

As an SRF app developer I want to be able to use Picture in Picture with my live center experience, where the player transitions from a non-covering modal to full-screen display, from both player layouts.

Currently the video layer disappears when returning from the full-screen layout when I enable PiP support at the code level. This should not happen.

Context: Pillarbox 2.0.0, iOS 17.

Acceptance criteria

Hints

Tasks

defagos commented 2 months ago

Fact: We cannot have two (or more) views displayed simultaneously, each with its own PiP controller. This prevents PiP from being automatically enabled when sending the app from background, probably because the system cannot pick the instance to use.

Remark

There is also an interesting canStartPictureInPictureAutomaticallyFromInline property we could provide support. This property makes it possible to automatically enable PiP, even when the view does not cover the whole screen. I quite think we could always enable this property when instantiating a PiP controller since, if PiP is not desired (not the main content), it should not be supported by a video view anyway.