androidx / androidx/media

mediaStatus.queueItems.count() always returns 2 items after adding multiple items via CastPlayer or RemoteMediaClient

Open
#2,639 1 comment 0 reactions 1 assignee View on GitHub

@AquilesCanta is already working on this.

Since Jul 23, 2025.

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

Description

Version

Media3 1.7.1 (same as 1.6.1)

More version details

I'm using the library androidx.media3:media3-cast:1.7.1 and noticed an issue when casting multiple media items to a Cast device.

Problem
After adding N media items to the Cast queue using either of the following:

CastPlayer.setMediaItems(...), or

RemoteMediaClient.queueLoad(...)

Inside the onStatusUpdated() callback, the call to remoteMediaClient.mediaStatus.queueItems.count() always returns 2, regardless of the actual number of items sent.

Details
On the receiver logs, all N items are correctly received. I tryed with default Cast receiver too and the result are same

The issue seems to be with the local MediaStatus object not reflecting the full queue.

Expected Behavior
The remoteMediaClient.mediaStatus.queueItems array should contain all items sent to the Cast device, accurately reflecting the full queue state.

This way, when you reach song 2, the next button in the notification is removed, because there are no more songs for the cast.

Notes
The items are successfully delivered to the receiver, as confirmed by its logs — but the Android-side status remains incorrect.

Let me know if you need a reproducible test case or more details!

Devices that reproduce the issue

Cast
device android

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

After enqueueing N songs and calling requestStatus()

Expected result

the response in onStatusUpdated should contain the number of songs sent to the Cast device.

Actual result

the response in onStatusUpdated contain only 2 songs

Media

any medias mp3

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

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.