Skip to content
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

Playback performance improvements #615

Merged
merged 6 commits into from
Oct 15, 2023

Conversation

naveensingh
Copy link
Contributor

This PR resolves some of the problems mentioned in #604

Major changes:

  • Only set mediaId on media items on the controller side and inflate as needed in the service
  • Update media3 to 1.2.0-alpha02 (includes some fixes)
  • Ensure we are loading media in a separate background thread instead of on the player thread.
  • Implement lazy seek to next/previous media item behavior to avoid doing too much work on large playlists.
  • Improve tracks recycler view when there are large items in the list

Related issues:

Tested playing ~4-5k items on a queue on a device with average specs and it worked pretty well. Large playlists kept getting slower and slower, 10k items are still not usable on below-average devices.

The previous ConstraintLayout + RelativeLayout + double nested ConstraintLayouts for each item was too slow and led to laggy scroll experience.
This makes the media controller more responsive, see androidx/media#81
It's costly for large playlists
@tibbi
Copy link
Contributor

tibbi commented Oct 15, 2023

should be good, will do more testing in the real app. Thanks

@tibbi tibbi merged commit 96c5bdf into SimpleMobileTools:master Oct 15, 2023
@naveensingh naveensingh deleted the performance_improvements branch October 16, 2023 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants