[need help] How to get metadata / IDtag?

robife

Member
Licensed User
Longtime User
Hi guys i need help with some "metadata" or what they call "idtag`s"
I have radio app but need to implement metadata on it on my app
to show song title, duration or cover of album. Streaming is mp3 file.

Hope somebody can help me
 

robife

Member
Licensed User
Longtime User



I think that is what Iam looking for, but how can I implement that in my script.
B4X:
#Region Module Attributes
    #FullScreen: True
    #IncludeTitle: False
    #ApplicationLabel: Radio Prime Halden
    #VersionCode: 3
    #VersionName: 2.1
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

'Activity module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    
    Dim MediaPlayer1 As MediaPlayer
    Dim b As MediaPlayerStream
    
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim Url As String
    Dim Label1 As Label
    Dim PhoneId As PhoneId
    Dim PE As PhoneEvents
    Dim barVolume As SeekBar

    Dim lblSPlay As Label 
    Dim lblSStop As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Activity.LoadLayout("view")
    'WebView1.LoadUrl("http://www2.radioprime.com/webradio/index.php?stasjon=halden")
    If FirstTime Then
        b.Initialize("b")
    End If
        b.Load("http://primestream.monsternett.no:8000/prime.mp3")
    
    Label1.Width = 100%x
    
    StartService(DetectCall)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)
        
End Sub


Sub Button1_Click
    b.Play
    lblSPlay.Text = "Playing"
        lblSStop.Text = "Pause"
            lblSPlay.Visible = True
                lblSStop.Visible = False
    
    
End Sub

Sub Button2_Click    
    b.Pause
    lblSPlay.Text = "Play"
        lblSStop.Text = "Paused"
            lblSPlay.Visible = False
                lblSStop.Visible = True
    
    
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
    If KeyCode = KeyCodes.KEYCODE_BACK Then
        If Msgbox2("Vil du lukke programmet?", "", "Ja", "Avbryte", "Nei", Null) = DialogResponse.POSITIVE Then
          '  Return False
 ExitApplication 'App is exiting
        Else
            Return True
        End If
    End If
End Sub

'Sub barVolume_ValueChanged (Value As Int, UserChanged As Boolean)
 '   b.SetVolume(barVolume.Value / 100, barVolume.Value / 100)
'End Sub
 
Upvote 0
Top