React-native-track-player: Not able to run remote urls on Android 9

Created on 9 Sep 2019  路  4Comments  路  Source: react-native-kit/react-native-track-player

Configuration

I am using react-native-track-player version 1.1.8

Issue

I am using the module to play remote url.
It works fine for all android versions less than 9 (Pie)
on Android 9, it fails to play from remote url while it can play a local audio file!

The url is a live streaming server, here it is: http://www.quran-radio.org:8002/i

Is there a solution for this issue?

Docs

Most helpful comment

On Android 9 and above unencrypted traffic is disallowed by default. Since your stream URL is not using https it will not play.

To turn off this setting, add this to your AndroidManifest.xml:

android:usesCleartextTraffic="true"

All 4 comments

On Android 9 and above unencrypted traffic is disallowed by default. Since your stream URL is not using https it will not play.

To turn off this setting, add this to your AndroidManifest.xml:

android:usesCleartextTraffic="true"

This should probably be added to the documentation at some point. I'll mark it as "docs" so we don't forget to do so.

I too facing same issue. added android:usesCleartextTraffic="true" in android/app/src/debug/AndroidManifest.xml, but still the issue is not fixed in Android 9 and above.
in Android 8 and below no issue.

Are you seeing any error or warning logs?

Was this page helpful?
0 / 5 - 0 ratings