Allow apps to provide custom Bundle equality logic
@icbaker is already working on this.
Since May 16, 2024.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
I'm having trouble with PlayerInterface.Listener.onTimelineChanged() not being consistently called when my SimpleBasePlayer-derived class updates an item's MediaMetadata.extra bundle and calls invalidateState().
I can see that this behavior is documented in various places:
- https://developer.android.com/reference/androidx/media3/common/MediaMetadata#extras()
Given the complexities of checking the equality of two
Bundleinstances, the contents of these extras are not considered in theequalsandhashCodeimplementation. - https://developer.android.com/reference/androidx/media3/common/MediaMetadata#equals(java.lang.Object)
Note: Equality checking does not consider
extras. - #470
I'm using the extras bundle to store information that changes at runtime (e.g. user-controlled tags), so I need some way to notify clients about changes. In order to force a playlist change when I modify the extras bundle, is my best bet changing the value of some arbitrary field in MediaMetadata, MediaItem, or SimpleBasePlayer.MediaItemData that I'm not currently using?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.