Closed defagos closed 12 months ago
The current API proposal fails as follows:
With the older API we had we used a binding which would retrieve the current selection not from an additional source of truth (a local state), but from the only reliable source of truth, namely the player.
For the same reason our current playback speed API, totally analogous, can be considered correct.
I implemented the caching strategy outlined in #595:
But I still think that not being able to use standard observability for menu implementation (and our mediaOption(for:) binding) is an API issue. I will therefore propose we cache media selection criteria at the player instead, thus mitigating the performance issues observed in https://github.com/SRGSSR/pillarbox-apple/issues/584. The criteria are changed very rarely by the user, so having them cached for the lifetime of the player is not a real issue in practice.
It comes at a small price but is likely our current best option until the performance issue is fixed, at which point the cache can simply be removed.
Description of the problem
With #584, #595 and #596 we attempted to mitigate iOS 17 performance issues associated with media selection criteria retrieval, attempting to build a coherent API in the process.
This sadly fails, though, since the current approach does not handle non-interactive changes at the menu level. We attempted to solve a performance issue with an API update, but the new API is sadly not good enough. We need a different approach, preserving our prior API while mitigating the performance issues.
Relevant stack trace or log output
No response
Reproducibility
Always
Steps to reproduce
PlaybackView
so that the forward button sets Japanese for subtitles.Library version
0.7.0
Operating system
iOS 17
Code sample
No response
Is there an existing issue for this?