EagerToLearn
EagerToLearn

Reputation: 675

MediaPlayer's prepareAsync seems to stop working on Android 9

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)

Upvotes: 1

Views: 803

Answers (1)

EagerToLearn
EagerToLearn

Reputation: 675

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

Upvotes: 1

Related Questions