apti
Member
I am using exoplayer to play both mp3 and radio streams. Works very nice. however I am using the following code to get the station name. thank erel for that. however I have a use case that needs something else. I have a list of cyrptic urls that play various radio stations. Is there a way to get the station name from each URL without having to play each? Let's say I have a list of things that are currently being played and I want to add a station to the list. I need to get the station name from the URL without stopping the playback of what is already playing. The station name of course will be stored with the URL. So I need to take the new URL and get the name without playing the new URL or stopping the currently playing one.
get station name:
Dim jo As JavaObject = MPL
Dim TrackGroups As JavaObject = jo.GetFieldJO("player").RunMethod("getCurrentTrackGroups", Null)
For i = 0 To TrackGroups.GetField("length") - 1
Dim TrackGroup As JavaObject = TrackGroups.RunMethod("get", Array(i))
For j = 0 To TrackGroup.GetField("length") - 1
Dim Format As JavaObject = TrackGroup.RunMethodJO("getFormat", Array(j))
' Log(Format)
Dim Metadata As JavaObject = Format.GetField("metadata")
If Metadata.IsInitialized Then
' Log("Metadata: " & Metadata) 'will not show you anything
Dim jo As JavaObject= Metadata.RunMethodJO("get", Array(j))
' Log (jo)
Dim mime As String = jo.GetField("name")
' Log(mime)
End If
Next
Next
Return mime