Skip to content

How to send different metadata to different controllers #3137

@nift4

Description

@nift4

Context: I want to implement "Car lyrics" feature, where the lyrics of the song are sent to the Car via Bluetooth AVRCP's song title field. Android automatically converts MediaSession metadata to AVRCP, so what I need to do is to change the MediaSession's metadata from Bluetooth.apk point-of-view, to change song title and artist fields. That is easy enough, for example with ForwardingSimpleBasePlayer.

However, I do not want every connected controller to be affected by this change. For example, my own app's UI, or external scrobbler apps (they listen to session metadata to create a listen history of the user, and sending lyrics in song title field will make them think the user is constantly switching song). Notably, I do not control external scrobbler apps, so I cannot resort to a custom command exchange for metadata.

I am aware of the caveat that media3 can only provide one MediaMetadata for all the legacy controllers due to platform limitations. However, in theory, media3 could provide one MediaMetadata for legacy controllers and some media3 controllers and another MediaMetadata for other media3 controllers. This would then work better for my usecase as more apps migrate to media3 controllers.

What is the best approach to implement this feature in your opinion? I can't really figure out a good hook point for this.

Thanks!

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions