Closed defagos closed 3 years ago
We can workaround the issue by displaying a dummy AVPlayerViewController
first. This prevents the issue from happening then.
Any tricky fix (siwzzling, dynamic subclassing, whatever) is too risky, and we haven't the time to find how this could be made.
This is really a tricky workaround. The memory graph showed an internal AVPlayerController
and more, getting the AVPlayer
alive.
With the workaround applied, the same peace of code releases the AVPlayer
itself, like on previous iOS versions.
Since the trick involves view controller presentation, I checked there is no negative impact on view appearance (e.g. duplicate -viewWillAppear:
calls which might trigger some app logic twice). Everything works as expected and the fact there is a secret presentation involved cannot be seen.
iOS 14 contains a regression due to changes required to make PiP available on iPhone. I first noticed this issue in Xcode 12 early beta versions, but I knew Apple was working on the feature so I tested each beta version to check for improvements.
I reported the issue end of August (FB8561088) since nothing improved. Now that iOS 14 is released we need an emergency fix.