RemoteCastPlayer silently ignores MediaChannelResult status for setPlayWhenReady, setPlaybackParameters, setRepeatMode and setVolume
I maintainer di solito rispondono entro 5 giorni
@tanay187 ci sta già lavorando.
Dal 14/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Version
Media3 1.11.0
More version details
androidx.media3:media3-cast:1.11.0 with play-services-cast-framework:22.3.1. Findings below come from reading the shipped bytecode of media3-cast-1.11.0.aar with javap -c -p.
Devices that reproduce the issue
Not device-specific. The symptom needs a receiver that rejects a request; mine was a Chromecast Audio on the Default Media Receiver (CC1AD845) with a second sender attached to the same session, which made the receiver answer Invalid Request.
Devices that do not reproduce the issue
n/a
Reproducible in the demo app?
Not tested
Reproduction steps
- Cast to a receiver that will reject a request. The reliable way is to join a Default Media Receiver session that another sender is also mutating, so the receiver's sequence numbers stop matching.
- Call
setPlaybackParameters(orsetPlayWhenReady,setRepeatMode,setVolume) on theCastPlayer. - Watch logcat and watch the app.
The Cast SDK reports the rejection:
W/MediaControlChannel: received unexpected error: Invalid Request.
W/MediaControlChannel: Possibility of local queue out of sync with receiver queue.
Refetching sequence number. Current Local Sequence Number = 6
Media3 does not, and the app has no callback through which it could learn.
Expected result
An app can tell that a request it issued was rejected by the receiver, so it can retry, reconcile, or tell the user. Media3 already does this for two other request families, which is why the gap reads as an oversight rather than a deliberate contract:
RemoteCastPlayer$SeekResultCallbackreadsStatus.getStatusCode()and logsSeek failed. Error code.RemoteCastPlayer$StatusListenerlogsSession start failedandSession resume failed.
Actual result
The ResultCallback<MediaChannelResult> instances used for the state setters never look at the result. RemoteCastPlayer$1.onResult is representative — it null-checks the client, clears the pending-result bookkeeping and flushes listener events, and that is all:
public void onResult(RemoteMediaClient$MediaChannelResult);
0: getfield this$0
4: invokestatic RemoteCastPlayer.access$1100 // remoteMediaClient
7: ifnull 28
10: ...
15: invokestatic RemoteCastPlayer.access$1200 // clear pending callback
22: invokestatic RemoteCastPlayer.access$1300 // listeners
25: invokevirtual ListenerSet.flushEvents
28: return
RemoteCastPlayer$2 through $5 have the same shape. None of the five references Status, getStatusCode, or isSuccess; by contrast SeekResultCallback does.
Tracing where those five are constructed, they cover:
| Callback site | Public API |
|---|---|
RemoteCastPlayer$1–$5 |
setPlayWhenReady(boolean), setPlaybackParameters(PlaybackParameters), setRepeatMode(int), setVolume(float), plus updateTracksAndNotifyIfChanged |
So a rejected play/pause, playback-speed, repeat-mode or volume change is indistinguishable from a successful one. The player's masked state reverts on the next receiver status, but nothing tells the app why, and nothing is logged.
The practical consequence for me: playback speed set locally did not take effect on the receiver, and there was no way to find out from the library whether the setPlaybackParameters request had been rejected or never mattered. I ended up re-applying the speed after STATE_READY as a workaround, without being able to confirm which of the two it was.
I have not traced the queue-mutation path (queueInsertItems, queueReorderItems, queueRemoveItems, load) to the same level of certainty, so I am not claiming anything about it here — though those also attach a ResultCallback through StateHolder and were what first sent me looking.
Logging a failure the way SeekResultCallback already does would be enough to make this diagnosable. Surfacing it to the app would be better.
Media
Not content-dependent.
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 1k
- Merge medio
- 8g 4h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di androidx/media
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
I maintainer di solito rispondono entro 5 giorni
-
Cast: system output switcher on Samsung One UI 9 (Android 17) only offers Samsung Audio Mirroring, never a Cast sessionForse già presa @tanay187 l’ha presa 3 giorni fa. Apertabug cast needs triage
androidx/media#3500 · 3 commenti · 2 assegnatari ·
I maintainer di solito rispondono entro 5 giorni
-
Waive ads when seek/start at the beginningForse già presa @microkatz l’ha presa 5 giorni fa. Apertaenhancement
androidx/media#3496 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 5 giorni
-
Since 1.9.0, skip buttons in SLOT_BACK / SLOT_FORWARD reach legacy controllers as custom actionsForse già presa @marcbaechinger l’ha presa 5 giorni fa. Apertabug
androidx/media#3495 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di androidx/media
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Shweit/EtherealPortals#30 ·
-
Typo in jakartaee-bom 12.0.0-SNAPSHOT with cdiForse già presa @ElectLive l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
jakartaee/jakartaee-api#205 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
liberation-data/drivine4j#547 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
BindingServiceProperties.bindings regressed to a non-thread-safe TreeMap in GH-3158: concurrent first use of binding names corrupts itForse già presa @AkashB23 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
spring-cloud/spring-cloud-stream#3321 ·
I maintainer di solito rispondono entro 1 giorno