Skip to content

[Cast] isCurrentMediaItemLive is true in ExoPlayer but false in CastPlayer #3318

Description

@jqi26

Version

Media3 main branch

More version details

No response

Devices that reproduce the issue

Pixel 8 Pro running Android 15

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

While implementing casting in our app, I noticed that Player.isCurrentMediaItemLive returns different values when playing locally and casting.

This is reproducible in the sample app by adding a live stream to androidx.media3.demo.cast.DemoUtil.java e.g.

samples.add(
    new MediaItem.Builder()
        .setUri(<LIVESTREAM_URL_HERE>)
        .setMediaMetadata(
            new MediaMetadata.Builder()
                .setTitle("Radio Station Title")
                .build())
        .setMimeType(MIME_TYPE_HLS)
        .setLiveConfiguration(new MediaItem.LiveConfiguration.Builder().build())
        .build());

Then you just need some way to check the value of PlayerManager.currentPlayer.isCurrentMediaItemLive(), e.g. breakpoints, logs. In the sample app I've added a button that invokes this method I added to PlayerManager:

public Boolean isCurrentMediaItemLive() {
  return currentPlayer.isCurrentMediaItemLive();
}

Which gets outputted in a Toast. You'll notice that the value is true when playing a live item locally, but if you start casting and check again, the value is false.


Specific repro steps in demo app in email

  1. Tap + FAB and select Radio Station Title
  2. Tap the tick FAB (bottom left button), the Toast will say "Current media item is live: true"
  3. Tap the cast button and start casting
  4. Tap the tick FAB (bottom left button), the Toast will say "Current media item is live: false" (even though its the same media item)
  5. Tap the cast button and stop casting
  6. Tap the tick FAB (bottom left button), the Toast will say "Current media item is live: true" again

Expected result

PlayerManager.currentPlayer.isCurrentMediaItemLive() returns true when casting and not casting

Actual result

PlayerManager.currentPlayer.isCurrentMediaItemLive() returns false when casting and true when not casting

Media

Will email a specific radio stream

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions