I'm getting the following back in Logcat starting MediaPlayer with a SPECIFIC URI. Normally every Uri, good or bad, will either play or come back with an error except this particular one.
I/MPS﹕ PrepAsync started
V/MediaPlayer﹕ message received msg=8, ext1=0, ext2=0
V/MediaPlayer﹕ unrecognized message: (8, 0, 0)
V/MediaPlayer﹕ callback application
V/MediaPlayer﹕ back from callback
... and hangs there.
I'm really just looking at how do I capture this conversation in an error handler but if someone knows the actual problem that's even better.
Source code FWIW:
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mediaPlayer.start();
}
});
}
try {
mediaPlayer.setDataSource(sUrl);
mediaPlayer.prepareAsync();
} catch (Exception e) {
Log.d(TAG, "Exception:"+e;
}
Also, I've tried creating an OnInfoListener, OnError and OnBufferingUpdateListener. These are never called. It's seems that mediaPlayer just goes away during onPrepareAsync.
Here is the URL if anyone is inspired to play with this.
http://54.196.206.122/entercom-koitfmaac-64
I just copy/pasted this into VLC to verify that the link is valid.
UPDATE: After looking at it more, if I wait long enough, eventually I get this:
I/dalvikvm﹕ threadid=3: reacting to signal 3
I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
UPDATE: This problem as was pointed out by Shubhang Malviya was that I needed to use URI.parse as:
mMediaPlayer.setDataSource(mContext, Uri.parse("http://54.196.206.122/entercom-koitfmaac-64"));