Skip to content
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

How to get metadata information like artist, genre, etc? #7946

Closed
Informatheus opened this issue Sep 18, 2020 · 5 comments
Closed

How to get metadata information like artist, genre, etc? #7946

Informatheus opened this issue Sep 18, 2020 · 5 comments
Assignees

Comments

@Informatheus
Copy link

I analyzed the references but was only able to find the title and url in the Metadata object. In my project I need more info like genre and artist. There isnt a way to get more information? Thanks in advance.

@marcbaechinger
Copy link
Contributor

marcbaechinger commented Sep 19, 2020

The MediaItem needs to be built by yourself with a builder. There is currently no support to automatically include the metadata of the media in the media item. We released a MetadataRetriever with 2.12 which allows to read metadata from a given media item stream/file.

I close this issue as a duplicate of #3609. Please join the conversation there.

@ChernyshovYuriy
Copy link

The MediaItem needs to be built by yourself with a builder. There is currently no support to automatically include the metadata of the media in the media item. We released a MetadataRetriever with 2.12 which allows to read metadata from a given media item stream/file.

I close this issue as a duplicate of #3609. Please join the conversation there.

Thanks Marc!
Any suggestion how to use it in case of media is represented by bytes array. Can't get uri or path to it, just a pure bytes array.
Thanks in advance.

@marcbaechinger marcbaechinger reopened this Oct 1, 2020
@marcbaechinger
Copy link
Contributor

marcbaechinger commented Oct 1, 2020

Sorry Yuriy! I didn't see your comment because it's closed Aside: You can reopen an issue if you think it makes sense (it makes sense in this case:). If an issue is closed it's not really visible anymore.

You can pass your own implementation of MediaSourceFactory to one of the static methods. The media item will then be passed to the createMediaSource method of the factory. Your factory then just uses a ProgressiveMediaSourceFactory to create the source and you can inject a ByteArrayDataSource which reads from your byte array.

Please look whether that works for you. Happy to help out some more if needed.

EDIT: (or actually you can probably create a ProgressiveMediaSourceFactory directly and pass that ByteArrayDataSource to the constructor of it. No need for a composition)

@ChernyshovYuriy
Copy link

Hey Marc,
Thanks a lot for advice. I will take a look. Meanwhile, I used MediaMetadataRetriever and it works as I need. I provided my own imp of MediaDataSource which reads bytes as needed.

@marcbaechinger
Copy link
Contributor

Ha! Great! You don't even need me! :D

@google google locked and limited conversation to collaborators Dec 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants