androidx / androidx/media

Player.Listener.onPlayWhenReadyChange not called in CastPlayer Remote Playback

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

@tanay187 is already working on this.

Since Jun 23, 2026.

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

Description

Version

Media3 1.9.2

More version details

There's an intermittent bug that after some connect-disconnect to the cast device, the Player.Listener.onPlayWhenReadyChange not called despite the player.playWhenReady is successfully changed.

Some workaround is to listen to Player.Listener.onEvents

override fun onEvents(player: Player, events: Player.Events) {
  super.onEvents(player, events)
    if (events.contains(Player.EVENT_PLAY_WHEN_READY_CHANGED)) {
      // This is called 
    }
}
Devices that reproduce the issue

Emulator

Devices that do not reproduce the issue
Reproducible in the demo app?

Not tested

Reproduction steps

It's an intermittent bug, but the steps roughly:

  1. Connect -> Disconnect -> Connect
  2. Toggle the playWhenReady
Expected result

onPlayWhenReadyChange is called when CastPlayer.playWhenReady changed.

Actual result

onPlayWhenReadyChange is not called

Media
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.