Hello, I am updating my apps , I have a audio streaming player working without any problem, so I wanted to start using the new features of B4A 10, I load the app and recompile, and there is no audio at all
anybody can help ?
basic code:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
Private player1 As SimpleExoPlayer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private playBtn As Button
Dim sources As List
Private SimpleExoPlayerView1 As SimpleExoPlayerView
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
player1.Initialize("player1")
sources.Initialize
sources.Add(player1.CreateUriSource("http://ny2.radiocast.us:8033/;"))
player1.Prepare(player1.CreateListSource(sources))
End If
Activity.LoadLayout("Layout")
SimpleExoPlayerView1.Player = player1
player1.Volume=1
player1.Play
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
End Sub
Sub playBtn_Click
player1.Play
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
Using http instead of https can be an issue. It is´nt permitted in newer Versions of Android.
Maybe this affects audio in this case too? I do not use Exoplayer.
fyi: i have no issue here with exoplayer on b4a 10: audio, video, http, https, sdk 28. also tried your radio stream. i do not specifically allow cleartext, but i have no problem with http. i believe this is due to exoplayer's not being part of android's framework. anyway, adding it (as per previous post) won't hurt. something else is going on on your end.
fyi: i have no issue here with exoplayer on b4a 10: audio, video, http, https, sdk 28. also tried your radio stream. i do not specifically allow cleartext, but i have no problem with http. i believe this is due to exoplayer's not being part of android's framework. anyway, adding it (as per previous post) won't hurt. something else is going on on your end.
first, thank you everybody for the help... still the problem.... after insert the cleartext on the manifesto (thank you @MarcoRome ) I have an error in the function Activity.LoadLayout
the issue is op's implication that b4a10 is the reason he has a problem with exoplayer. my point was that b4a10 is not the reason since i'm running an exoplayer app compiled with b4a10 that runs on android 8 and android 10.
first, thank you everybody for the help... still the problem.... after insert the cleartext on the manifesto (thank you @MarcoRome ) I have an error in the function Activity.LoadLayout
@drgottjr what do you mean ? what to look?? I tough b4x handle all these files , or do I have to recreate all?
I have the audio working, I erased the SimpleExoPlayerView (looks like there some kind of cache after compiling) after a few re-compile hits the problem is gone, tryied again inserting the customeview and the problem is back
line numbers listed in the log refer to java files that make up your project. you tell your editor to go to that line number. that line will show you the error AND it will reference the b4a line number so you can correct the error.
go to the objects folder in your project, then to src. keep going deeper (2, maybe 3 levels). in there you'll see at least 1 .java file. the main one is main.java. b4a is converted to java during the compilation process. then to byte code. you can see the java files easily. every time you compile your project, the .java files are created. just go to your objects folder now and follow the trail. the .java files should be there waiting. line 39 in main.java.
i use the simpleexoplayerview, so if you use a custom view, you'll have to track down the error in the main.java file