I can successfully listen to an audio stream with the MediaPlayer interface, but how can I get properties of the stream like the current bit rate, or the stream text (lots of streams like on line radios include the currently playing track)?
I tried to find this information but couldn't, if these things are possibly is there a list somewhere on the android dev site where the various available 'properties' are listed?
First, the Android DEV site is the site with all class information - but sometimes hard to find what you need. In that case, checking the java source of the class can be quite helpful.
From a quick look into the SDK, there is an onInfoListener
interface, which you can implement in a class extending MediaPlayer
. That needs you to have public boolean onInfo(MediaPlayer mp, int what, int extra)
implemented.
http://developer.android.com/reference/android/media/MediaPlayer.OnInfoListener.html states there is a what=MEDIA_INFO_METADATA_UPDATE
.
But - checking google for that would give the idea that this never gets called :-/ So eventually you are on your own with that...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With