When I try to play an audio mar form url I receive the error: E/MediaPlayerNative: error (1, -2147483648)
Here is my code:
public void playAudio(final String url){
try {
Uri uri = Uri.parse(url);
MediaPlayer player = new MediaPlayer();
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setDataSource(MainActivity.this, uri);
player.prepare();
player.start();
} catch(Exception e) {
System.out.println(e.toString());
}
}
What is wrong?