-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add util to convert Metadata into MediaMetadataCompat #5031
Comments
From where do you extract that metadata? |
This would probably help devs with https:/google/ExoPlayer/blob/release-v2/extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/TimelineQueueEditor.java#L73 and https:/google/ExoPlayer/blob/release-v2/extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java#L692 By providing a standard way to extract metadata from tracks into |
Also related to #3609 |
This would help you for providing a notification of the item which is currently playing and the metadata of the media session. You still have to provide MediaDescriptionCompat for queue items which have never been played. Do I understand correctly? |
@marcbaechinger for me this would especially be useful when the ID3 tags of a media file are filled with in the metadata. If it was possible to extract ID3 from a file or url into a For the Partial reason for all of this would also be performance, as it is hard to make a performant |
@marcbaechinger Would it be an idea to add FFmpegMediaMetadataRetriever as a plugin for this? See Usage of how they extract metadata. I still think there are a lot of use cases for this issue, especially around the notifications and mediasession integration. Currently it's hard to get any information out of a media source in exoplayer. One of the examples given is: @Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
for (int i = 0; i < trackGroups.length; i++) {
TrackGroup trackGroup = trackGroups.get(i);
for (int j = 0; j < trackGroup.length; j++) {
Metadata trackMetadata = trackGroup.getFormat(j).metadata;
if (trackMetadata != null) {
// We found metadata. Do something with it here!
}
}
}
} There is just no way to actually do something with the metadata that is found there. It should be possible to create a list of |
Issue description
Currently it's hard to extract metadata information and using it in the
MediaSessionConnector
. To make it easier i would suggest to add a conversion util that convertsMetadata
into aMediaMetadataCompat
which can already be converted into aMediaDescriptionCompat
.This way it could be used to updated metadata on notifications, lockscreen and cast.
Reproduction steps
None
Link to test content
None
Version of ExoPlayer being used
2.9.0
Device(s) and version(s) of Android being used
All
A full bug report captured from the device
None
The text was updated successfully, but these errors were encountered: