When I open a URL that Starts with "https://" in simple exo player, Video plays well. But whenever I tries to play non secure ("http://") URL it don't work. If you have any solution of this question then please answer ?
-
What is "simple video player"? You might consider editing your question and providing a [mcve] showing what you are using and explaining in detail what "it don't work" means. – CommonsWare Nov 07 '21 at 16:15
-
Simple Exo Player – Ajay Nov 07 '21 at 16:21
-
1Does this answer your question? [Android 8: Cleartext HTTP traffic not permitted](https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted) – Andre Classen Nov 07 '21 at 16:28
-
What does ExoPlayer log in Logcat when you try playing? See [the ExoPlayer docs](https://exoplayer.dev/troubleshooting.html#fixing-cleartext-http-traffic-not-permitted-errors) for more about HTTP/HTTPS support. – CommonsWare Nov 07 '21 at 16:34
-
Please provide enough code so others can better understand or reproduce the problem. – Community Nov 08 '21 at 09:50
1 Answers
This error will occur if your app requests cleartext HTTP traffic (i.e., http:// rather than https://) when its Network Security Configuration does not permit it. If your app targets Android 9 (API level 28) or later, cleartext HTTP traffic is disabled by the default configuration.
If your app needs to work with cleartext HTTP traffic then you need to use a Network Security Configuration that permits it. Please see Android’s network security documentation for details. To enable all cleartext HTTP traffic, you can simply add android:usesCleartextTraffic="true" to the application element of your app’s AndroidManifest.xml.
The ExoPlayer demo app uses the default Network Security Configuration, and so does not allow cleartext HTTP traffic. You can enable it using the instructions above.

- 56
- 7