Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Dim mp As MediaPlayerStream
Private Label1 As Label
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Return Me
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("ly_radio")
mp.Initialize("mp")
mp.Load("https://uk3.internet-radio.com/proxy/mkhr/live")
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Sub mp_StreamReady
Label1.Text="Playing"
mp.Play
End Sub
Sub mp_StreamError (ErrorCode As String, ExtraData As Int)
Label1.Text="Error: " & ErrorCode & ", " & ExtraData
End Sub
Sub mp_StreamBuffer(Percentage As Int)
Label1.Text="Buffering: " & Percentage
End Sub
Sub btnStop_Click
mp.stop
End Sub