Android MediaPlayer Won't Stream from HTTP

57 Views Asked by At

When setting a MediaPlayer DataSource to a HTTP URL as opposed to an HTTPS URL, no audio streams and MediaPlayer error code -38 is displayed in logs.

1

There are 1 best solutions below

0
John Harrington On BEST ANSWER

I attempted to connect to the stream using ExoPlayer instead, and received this error. Following the docs suggestion, I added the following line of code to the application tag of my application's manifest file:

        android:usesCleartextTraffic="true"

I am now able to connect to the stream at HTTP URL using both ExoPlayer and MEdiaPlayer.