
We currently have multiple places in ExoPlayerImpl that assign PlaybackInfo instances and then inform listeners of all current changes. This is not ideal because it causes multiple issues: 1. Some changes may easily be forgotten, e.g. there are clearly some checks missing to see if isPlaying changed (e.g. in seekTo or setMediaSources) 2. Some callbacks didn't check if the value actually changed before sending the callback (e.g. for the timeline change in setMediaSources - if the timeline is still the same, we shouldn't send a onTimelineChanged event). 3. Having multiple callbacks in a single Runnable changes the order of listener invocations slightly: Currently all events for one listener will be send first before moving to the next listener. It should however send a single event to all listeners first before moving to the next event. All these issues can be solved by always using updatePlaybackInfo and never assigning playbackInfo directly in another place. Some tests needed to be updated as well because of issues (2) and (3). Also added a new test to cover issue (1). PiperOrigin-RevId: 302844981
ExoPlayer library
The ExoPlayer library is split into multiple modules. See ExoPlayer's top level README for more information about the available library modules and how to use them.