Hello gehrlekrona,
Yes I did, the easy way to do this is create a little service to play a URL with mp3, look
In your activity, call like:
if TocandoMusica.IsPlaying = False Then
TocandoMusica.URLMusica = "
http://www.ultraje.com/mp3/rebelde.mp3"
StartService(TocandoMusica)
end if
and create a service with this name "TocandoMusica"
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
Dim URLMusica As String
Dim n As Notification
Dim mediaPlayer1 As MediaPlayer
Dim mp As MediaPlayerStream
Dim IsPlaying As Boolean
End Sub
Sub Service_Create
mp.Initialize("mp")
mp.Load(URLMusica)
Log("Musica = " & URLMusica)
End Sub
Sub mp_StreamReady
Log("mp_StreamReady")
mp.Play
IsPlaying = True
End Sub
Sub mp_StreamError (ErrorCode As String, ExtraData As Int)
Log("Error: " & ErrorCode & ", " & ExtraData)
ToastMessageShow("Error: " & ErrorCode & ", " & ExtraData, True)
IsPlaying = False
End Sub
Sub mp_StreamBuffer(Percentage As Int)
'Log(Percentage)
End Sub
Sub Service_Start (StartingIntent As Intent)
n.Initialize
n.OnGoingEvent = True
n.Sound = True
n.Vibrate = True
n.Icon = "icon"
n.SetInfo("Ultraje > " & URLMusica, "", Main)
n.autocancel = False
n.Notify(1)
End Sub
Sub Service_Destroy
mp.Stop
n.Cancel(1)
IsPlaying = False
End Sub