SRGSSR / srgmediaplayer-apple

An advanced media player library, simple and reliable
MIT License
159 stars 33 forks source link

iOS 13 compatibility #68

Closed defagos closed 5 years ago

defagos commented 5 years ago

Here is a list of what is not correctly working in iOS 13, or what needs to be done, as of Xcode 11 b4:

What should not be fixed yet since likely to be iOS 13 beta bugs (to be investigated and reported as bug if needed):

What must be reported as bug to Apple:

defagos commented 5 years ago

I recommend we do not do anything with the failing UT until the iOS 13 RC. It is probably just a simulator issue which will be ironed out with upcoming betas and release candidates.

defagos commented 5 years ago

~I spotted what is probably a bug with dark mode implementation and layout traits update propagation through window / view controller / view hierarchies when a presentation controller is involved. The presented view controller does not correctly receive the traits collection update.~

~I think this is a bug because:~

~I should file a radar, but no workaround should be made. For the moment this means that the tracks popover style will not be correctly updated when toggling dark mode while it is visible. Reopening it fixes the issue. We'll then see how this improves with further betas.~

~What is strange, though, is that a popover found in Safari behaves well. Maybe I do something wrong, but what?~

This was definitely an implementation issue on our side. We namely were taking control of the view controller style with overrideUserInterfaceStyle in all cases (even when not specified with our own corresponding unspecified style), which was disabling traits change at the view controller boundaries. The issue could simply be fixed by only setting an override when the behavior must be overridden.

defagos commented 5 years ago

Other issue spotted, with modal presentation on iPhone in landscape orientation. Rotating from portrait leaves an offset at the top. Moreover, the animation is ugly when opening the tracks popover in landscape orientation.

Probably a bug, and probably already reported. Still we should have a look.

defagos commented 5 years ago

PiP seems to restore poorly when leaving the app before triggering restoration with the dedicated button. This does not work well for the system player either in our SRG Media Player demo.

For picture in picture restoration, it seems a new UIViewController is added to the top of the view hierarchy to hold the PiP view.

I wouldn't attempt to fix this issue now, even if presenting the restored player on the root view controller, the result does not work correctly.

Note that the WWDC app runs fine, though, but has not probably been built with iOS 13 (our Play SRG production apps do not work so well, though they have been built with iOS 12).

defagos commented 5 years ago

I fixed play button issues by having proper resources for everything, which was previously not the case. I used SF Fonts to generate a more consistent icon set, which should be easier to understand than the previous one (though the previous one was inspired by system players themselves, having a QuickTime icon when playing audio was... ugly).

At some point I also observed the SF Font play icon (hollow), probably because it was referenced in a storyboard. It is surprising that this could be mixed up with our own icon names (we coincidentally have a resource named play). I haven't observed this issue in beta 5 for the moment, and having a more consistent PDF-based icon set will probably fix this issue once and for all. We should not spend more time investigating this issue.

defagos commented 5 years ago

The code has been made compatible with Xcode 10. The improvements made for iOS 13 (most notably dark mode for iOS < 13 or improved popover behavior) should namely be merged into develop before Xcode 11 is officially released.

Once Xcode 11 has been released, preprocessor sorcery to make the project compile on Xcode 10 must be removed, and Xcode 11 declared as required to build the project.

defagos commented 5 years ago

~The AirPlay button issues seems rather related to the resource we use. At the Letterbox level, with another resource overriding it, everything works!~

The problem is not related to the resource, but to a bug. This is easy to be seen by considering the two following use cases:

  1. Kill the app to start anew. Open a stream with SRG Media Player view controller, and enable AirPlay. The button is not highlighted when AirPlay is active.
  2. Kill the app to start anew. Open the AVPlayerViewController demo first, enable AIrPlay (button correctly highlighted), then disable it, and close the player. Now proceed as above for SRG Media Player view controller. The AirPlay button will then correctly work.

This should be definitely reported to Apple as a bug.

defagos commented 5 years ago

The PiP restoration animation is sometimes buggy in SRG Media Player demo when run on iOS 13b6. We should probably wait until b7, it seems Apple engineers are working on the feature and will likely fix this issue.

defagos commented 5 years ago

Reported to Apple:

defagos commented 5 years ago

Preliminary support has been delivered in version 2.8. The only remaining issues have been reported to Apple. When the GM is ready we will be able to deliver iOS 13 support officially, closing this issue in the process.

defagos commented 5 years ago

iOS 13 support validated with the GM without required change. Version 2.8 has therefore been promoted as iOS 13 compatible.