Android Question ExoPlayer and targetSdkVersion="21/29"

Nando

Member
Licensed User
Longtime User
Hello guys,
I'm experimenting with ExoPlayer and when I use in the manifestes android:targetSdkVersion="21"

everything is working properly… but if I switch to android:targetSdkVersion="29"

this always works

sources.Add(player1.CreateUriSource("https://html5demos.com/assets/dizzy.mp4"))

but for example :

sources.Add(player1.CreateUriSource("http://stream.maxfm.be:9290/;stream.aac"))

which worked well with targetSdkVersion="21" but gives me this error with targetSdkVersion="29" :

Error: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to http://stream.maxfm.be:9290/;stream.aac


P.S. I have the same problem with AacMp3Player

if anyone has a suggestion to this problem, I'll take it.
Thank you in advance
 

JohnC

Expert
Licensed User
Longtime User
Make sure you enable "cleartext" (allow non-ssl connections) in manifest when setting API to 29 by adding this line:

B4X:
SetApplicationAttribute(android:usesCleartextTraffic, "true")
 
Upvote 0

Nando

Member
Licensed User
Longtime User
Hi John,
I tried to add this to the manifesto but without success.
However currently with an https address instead of http it works.

See this post

I will continue to study this, but at least now I know where the problem comes from.

Thank you very much for your quick help.
Nando
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…