Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Quick research tells me that <code>android.media.MediaPlayer</code> only cares about stream data and nothing else. Therefore, if you want to also retrieve the stream's metadata (the station name, artist, song, etc.), you must do it separately, using a different object.</p> <p>The <code>android.media.MediaMetadataRetreiver</code> class seems to be built to do exactly that. It looks like you should research the <code>MetadataRetreiver.extractMetadata()</code> function along with the <code>METADATA_KEY_ARTIST</code> and <code>METADATA_KEY_TITLE</code> keys.</p> <p>Here is <a href="http://developer.android.com/reference/android/media/MediaMetadataRetriever.html" rel="nofollow noreferrer">the MediaMetadataRetreiver API</a>. Also, look at <a href="https://stackoverflow.com/questions/6638251/how-retrieve-metadata-from-shoutcast-on-android">this previous StackOverflow question</a>.</p> <p>I am not an Android developer so I cannot guarentee my code is correct but I think it looks something like this:</p> <pre><code>MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever(); metaRetreiver.setDataSource(RADIO_STATION_URL) String artist = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST; String title = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE); </code></pre> <p>(Full disclosure: code modified from <a href="https://stackoverflow.com/questions/10385178/mediametadataretriever-extractmetadata-method-returning-null">here</a>)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload