这是indexloc提供的服务,不要输入任何密码
Skip to content

MediaLibraryService: Unable to hide duration in Android Auto for live streams #2562

@anshuhexabrain

Description

@anshuhexabrain

Hi team,

First of all, huge thanks to the Media3 team for providing the MediaLibraryService—it's been a great experience integrating Android Auto support using this service. The structure is clean, and the onboarding has been much smoother compared to previous APIs. 🙌

I'm working on an Android Auto integration using MediaLibraryService from the Media3 library. In my app, I need to support live streams where the duration is undefined or unknown.

MediaMetadata.Builder()
    .putLong(MediaMetadata.METADATA_KEY_DURATION, -1L)
    .build()

should theoretically hide or disable the time duration display in the Android Auto player UI. However, even after setting METADATA_KEY_DURATION = -1L, Android Auto continues to show the duration bar and values like 0:00 / 0:00, which is misleading for live content.

🔍 What I tried:
Set duration as -1L in MediaMetadata.

Returned this metadata via onGetChildren and onGetItem from MediaLibraryService.

Confirmed the metadata is correctly received in the MediaBrowser.

📸 Screenshot:
Here's an actual screenshot showing the issue where a live stream is still showing duration values:

❓ Questions
Is there an officially supported way to suppress the duration in Android Auto UI for live streams using MediaLibraryService?

Does Media3 have any known limitations or requirements for Android Auto to respect METADATA_KEY_DURATION = -1L?

Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions