Android Question ExoPlayer Metadata

Scantech

Well-Known Member
Licensed User
Longtime User
if you going to use meta, GetVideoTextLanguages2 and getaudiolanguages i would switch to Addo Exoplayer.

Download their example. It shows you how. Erels exoplayer meta and textlanguage may have some flaw to it as its not updated.

You call this in Player_ready event. then that meta sub gets triggered. in addo exo library.
B4X:
Sub Player_Ready
    Player.TrackMetadata
End sub

B4X:
Sub Player_MetaData(metadataFields As Map)
'    Log(metadataFields)

    If metadataFields.ContainsKey("Title") Then
'        Log(metadataFields.Get("Title"))
    End If
  
    If metadataFields.ContainsKey("RecordingYear") Then
'        Log(metadataFields.Get("RecordingYear"))
    End If
  
    ' Handle the metadata fields here
    If metadataFields.ContainsKey("ArtworkData") Then
'        Log("Contains ArtworkData!!!!!!!!!!!!")
'        Dim artworkData() As Byte = metadataFields.Get("ArtworkData")
        ' Create an InputStream from the byte array
'        Dim inp As InputStream
'        inp.InitializeFromBytesArray(artworkData, 0, artworkData.Length)
        ' Create a Bitmap from the InputStream
'        Dim bitmap As Bitmap
'        bitmap.Initialize2(inp)
'        ImageView1.Bitmap = bitmap
'        ImageView1.Visible = True
    End If
  
    Player.GetVideoTextLanguages2  'put here just like the ado example
End Sub
 
Last edited:
Upvote 0

oligo92

Member
...sorry, I missed my previous post. Continued:
Thanks. The "TrackChanged" event is only triggered once for streaming webradios, not at each song. I only get the radio name, genre and bitrate. Not sure Addo solution will do better...
 
Upvote 0
Top