-
Notifications
You must be signed in to change notification settings - Fork 11
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
Publish consolidated item context #559
Comments
Here are the item properties that currently require the item to be ready to play before being meaningful:
In fact these are all properties of interest for an item, it is therefore likely we should consolidate everything item-related. |
I implemented a PoC with hierarchical state management on
Properly implementing this architecture is quite some work, though. We should:
The robustness achieved with this approach should really benefit our player, I think the result would be worth the investment. In effect this is like having our player be a simple collection of stored properties accessing its internal A final advantage of this approach is expressiveness. We only need to add a new source of change to the context structure when needed (only low-frequency sources, no time-related ones), then add computed properties to extract interesting consolidated information (e.g. playback state), the implementation being expressive about what is combined. In a sense this is a single source of truth approach where the source of truth is built by a context publisher and valuable consistent information can be extracted from it at any time. TL;DR: We need to:
|
Things to do:
|
We have removed all the code we had to manage errors in playlists. Now back navigation will get stuck on failed items but this should be a corner case. In most cases the user will probably have another way of getting back to items prior to the failed one anyway (e.g. a playlist item selection interface). For the moment we decided to keep things simple. We will improve the situation later if the need arises. |
Regarding import optimization, some imports are superfluous when they involve a category (in this case any file in the same module can perform the import so that the code compiles). This is a compiler bug but imports can still be optimized in the following way:
In some cases, e.g. where we have to import We decided to perform only 1 and to currently use the compiler bug to our advantage (we won't also import Strict imports are still not addressed but there are likely workarounds for cleanup. |
We have entirely revisited our reactive player implementation:
Some work remains to possibly consolidate more state (items and playback speed) but this has been deferred to other issues. |
As a Pillarbox developer I want to build complex behaviors on consistent state. Currently essential item-related information (status, seekable ranges, media selection, etc.) stems from various asynchronous sources which might not deliver the same information at the same time, which can lead to subtle synchronization issues.
Context
When implementing track analytics (#508) we discovered that the initial
play
event has undefined audio and subtitle selection information. While this is not an issue according to our specifications this is still puzzling.The issue is related to the fact that our tracker subscribes to various sources of change, several of which are separately dependent on the item
status
. In many cases relevant information like the current media selection, for example, is only delivered once the item is ready to play. The item state publisher and these other publishers, all dependent on the item status, deliver their changes at different times (almost at the same time), leading to an inconsistent picture.Thus we should attempt to:
This should have no negative impact on our asynchronous / reactive approach but would increase state coherence. It would likely be a bit more challenging to test context updates globally but we can likely still test individual sources of change.
If we can rewrite our implementation with this strategy initial
play
events should readily have correct media selection information.Acceptance criteria
Tasks
The text was updated successfully, but these errors were encountered: