1

I thought I found a way to do this, but it seems like this is for exoplayer1 (the first answer to this question): Extracting metadata from Icecast stream using Exoplayer

I already have a way to read Icy metadata, but it uses a stream of it's own, so it creates extra data costs for the user.

How can this be done just using one instance of the stream?

Community
  • 1
  • 1
Johan Hovda
  • 855
  • 2
  • 10
  • 23

1 Answers1

0

This can be done easily by registering a listener for your ExoPlayer instance:

exoPlayer.addListener(new Player.Listener() {
    @Override
    public void onMediaMetadataChanged(MediaMetadata mediaMetadata) {
        String title = (String)mediaMetadata.title; // This is the artist / song
    }
}
Marek Potkan
  • 452
  • 2
  • 9