Play url (mp3) from online url - getting error

b4AMarkO

Member
Licensed User
Longtime User
Trying to use MediaPlayerStream
Im getting error at

Dim mp As MediaPLayerStream .... Note I just purchased the Full version .... not sure that matters

Here is the code I am using ......

B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
  Dim mp 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.
   
    
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")
     'http://relay.radioreference.com:80/264858664
    If FirstTime Then
        mp.Initialize("mp")
    End If
    mp.Load("http://relay.radioreference.com:80/264858664")
End Sub
Sub mp_StreamReady
    Log("starts playing")
    mp.Play
End Sub
Sub mp_StreamError (ErrorCode As String, ExtraData As Int)
    Log("Error: " & ErrorCode & ", " & ExtraData)
    ToastMessageShow("Error: " & ErrorCode & ", " & ExtraData, True)
End Sub
Sub mp_StreamBuffer(Percentage As Int)
    Log(Percentage)
End Sub 
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

stevel05

Expert
Licensed User
Longtime User
Have you selected the Audio Library bottom right of the IDE, select the Libs tab then select Audio.
 
Upvote 0
Top