Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PiP should not be started when no Letterbox view is attached #256

Open
defagos opened this issue Nov 18, 2021 · 3 comments
Open

PiP should not be started when no Letterbox view is attached #256

defagos opened this issue Nov 18, 2021 · 3 comments

Comments

@defagos
Copy link
Member

defagos commented Nov 18, 2021

If no Letterbox view is attached, PiP might still be automatically enabled. This should not be the case.

Issue type

Incorrect behavior

Environment information

  • Library version: 7.3.1
  • iOS: Tested with 15.1 and 14.8
  • Device: Physical

Reproducibility

Always reproducible

Steps to reproduce

  1. Play the SWI VOD example.
  2. Use the toggle button to detach the Letterbox view from its controller.
  3. Send the app to the background.

On iOS 15 PiP is automatically enabled. On 14.8 the behavior is left in an inconsistent state.

@defagos
Copy link
Member Author

defagos commented Nov 22, 2021

Can be reproduced in SRG Media Player controller demo:

  1. Edit the code to have a button which removes the controller view from its parent view in the advanced demo.
  2. Start playback.
  3. Tap on the button.
  4. Send the app to the background.

Note that the view has to be displayed once at least. If the view is removed before playback (or not installed at all), the issue does not appear.

@defagos
Copy link
Member Author

defagos commented Nov 22, 2021

It is obvious that this behavior is related to the fact that a PiP controller is bound to the player layer, even if this layer is not installed in the hierarchy.

We cannot destroy the PiP controller to avoid this behavior when the layer is not installed, as this would break PiP as soon as the player view is removed from the hierarchy (e.g. player screen dismissal when PiP is entered). For this reason I think there is no way to solve this issue.

I'll check the behavior on iOS < 14 to see if this is an iOS regression which appeared with iOS 14, but I doubt we can do more than reporting this issue to Apple.

@defagos
Copy link
Member Author

defagos commented Nov 22, 2021

Tested with iOS 13.7, the behavior is correct: If the video layer is attached, playback is paused when moving to the background with the LB view dissociated from the player, and no PiP overlay appears.

It seems to me this is really an iOS 14 regression which we cannot do much with. We should keep track of potential improvements made in later iOS releases and, if this is really an issue, open a dedicated Apple bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant