1

I'm using MediaPlayer to play mp3 files (url) and everything is working great.

mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setDataSource(url);

prepareAsync();

mediaPlayer.setOnPreparedListener(onPreparedListener);
mediaPlayer.setOnCompletionListener(onCompletionListener);

But when tested on Android Pie (9), it just stops working...

I checked the logging but the error is kind of not very clear :

E/MediaPlayer_JAVA: Error (1,-2147483648)

sharonooo
  • 684
  • 3
  • 8
  • 25
EagerToLearn
  • 675
  • 7
  • 24

1 Answers1

1

After a while struggling with the issue, I decided to change to ExoPlayer and the problem persits, but the error was clearer, and here is the solution : Android 8: Cleartext HTTP traffic not permitted

EagerToLearn
  • 675
  • 7
  • 24