Android Question No errors being returned by MediaPlayerStream

CRoberts

Member
Licensed User
Longtime User
I have a mediaPlayerStream that plays a radio station. When it is connected to the internet after maybe 20 seconds it starts playing. When not connected nothing happens.
I'm expecting mp_streamerror to be fired if there is no connection to the internet
I'm assuming that mp_streamBuffer will fire during the buffering process
but I don't see any of these events being fired.
Any reason?

B4X:
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
 
Top