pillarbox-apple
pillarbox-apple copied to clipboard
Improve playlist business model object support
As an app developer I would like to be able to:
- Update the business model objects from which I created a playlist (e.g. with a network call) without reloading player items that did not change, and without writing any additional sync code.
- Display business model object information on playlist UI components.
- Listen to current item changes in some nice reliable way.
- Restart playback of the current item when tapping it (as was previously possible).
Context
As discussed with SRF app developers, we introduced several changes with 4.0.0 that might not deliver entirely what they were supposed to deliver:
-
Player
was updated to manage playlist items and associated business model objects for the application, with the ambition to remove sync code entirely at the app level. But we only addressed the case where the playlist business model objects are loaded once and attached to player items with a newsource
property. In this case the business model objects are kept in sync with the player item when reordered or removed. But when the business model objects are updated (e.g. network call) the sync code we wanted to eliminated still has to be written at the app level so that player items can be reused if their business model object did not change. - We allowed apps to associate arbitrary
source
information with player items, but this might not be ergonomic enough. We cannot / don't want to have thePlayer
itself restrict items to be of specific source type but maybe there is a solution still to be found. At least an approach that provides a better access to typed information - There is no publisher associated with current item changes. In the case of SRF apps there is a need to be able to observe these changes (to manage sync between playback in web and mobile contexts).
Acceptance criteria
- The API has been updated to better address the above needs.
- The API has been discussed with SRF developers to see if it better suits their needs.
- The demo has been updated accordingly.
Tasks
- [ ] ...