androidx / androidx/media

Large playlist loading issue - is there a callback for completion of addmediaitems?- specifically with audio tracks

Open
#2,724 3 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Aug 18, 2025.

question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

How does the Team recommend we load a large number of audio type mediaitems to a player? We haven't been able to find a means of determing when a request to addmediaitems has completed, to allow an efficient load.

Where we may have say 1000 or more mediatiems, which are audio tracks - mp3, etc. Loading is extremely slow and is unacceptable in terms of the UI experience.

We would like to split the list of mediaitems into smaller chunks, then sequentially add them to the player or controller. Which is all fine in theory, but one major issue we are noting is that there doesn't seem to be a practical means of determining when addmediaitems has finished adding a group of items. Sure, we can use the callbacks on the timeline, but this is called repeatedly for irrelivant events., and requires analysis, which is slow and not practical as a means to determine whether addmediaitems has completed.

What is the most effective way to determine when addmediaitems has completed?

Seems like a trivial issue, but it is critical to ensure an app performs adequately when loading large lists. We can't seem to find a solution which doesn't involve analysing the timeline, checking items in the controller and so forth which is not acceptable for production due to the lag incurred.

Surely there must be a means of determining when addmediaitems has completed? Is there not?

Thanks in advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.