Player.ClearMediaItems
If url.EndsWith("m3u8") Then
Player.Add_media_Source(Player.CreateHLSSource(url))
Else
Player.Add_media_Source(Player.CreateUriSource(url))
End If
Player.Prepare
Player.Play
addoPlayer.ClearMediaItems
Dim sources As List
sources.Initialize
sources.Add(addoPlayer.CreateUriSource("http://tsfjazz.ice.infomaniak.ch/tsfjazz-high.mp3"))
addoPlayer.CreateListSource(sources)
Media3PlayerView1.Player = addoPlayer
' Important to call this method Before Playing
addoPlayer.Prepare
addoPlayer.Play
I'm using the CreateUriSource as per your example for this webradio but it is going to IDLE. I'll be glad you send me your complete B4X project to check it's working at home (configuration issue?)
Thanks
Actually, it seems this issue is because my code was on a B4XPages project, not in the Main module of a Default project (I tried with this configuration - maybe the same than for your code). No idea why....
I have to rewrite my code.
Yes, changing the app from a B4XPage project to a Default one make the thing work. That's the (right) way your app was done.
I don't get the reason (would be curious to know why) but after all, the important is to make the things work
One last issue is to fix is the problem of the "connection lost" (player does not sound anymore) after some minutes when the phone is not used (and the screen black). Any idea on this?