Reputation: 11191
Does anybody know what does the second argument mean from this error (1, -2147483648) in MediaPlayer? I constantly receive it when attempting to play an audio from a url stream. I try to play it from a class that extends BaseExpandableListAdapter if that matter. I have already reviewed this post Android MediaPlayer error: MediaPlayer error(1, -2147483648) on Stream from internet however all the answers refers to the stream support issues. It's not a stream support issue in my case since I am able to play an audio from the same stream but just using a different class. This is a method that I'm using for playing:
private void startPlaying(String fileName) {
mediaPlayer = new MediaPlayer();
try {
if (fileInputStream != null) { // Read a file from a fileInputStream from a filesystem (EXTERNAL OR INTERNAL storage)
mediaPlayer.setDataSource(fileInputStream.getFD());
Log.d("MediaPlayer is playing", "from device");
} else {
// mediaPlayer = new MediaPlayer();
mediaPlayer.setDataSource(getFilePath()); // Read a file from a url
Log.d("MediaPlayer is playing", "from stream");
}
mediaPlayer.prepare();
mediaPlayer.start();
mediaPlayer.setOnCompletionListener(new CompletionListener());
} catch (IOException e) {
Log.e(LOG_TAG, "prepare() failed");
}
}
Upvotes: 0
Views: 3535
Reputation: 20563
The error is usually one of these in this case:
Here's a good blog that outlines these situations and how to fix them:
http://www.weston-fl.com/blog/?p=2988
Also see this thread:
Android mediaplayer MediaPlayer(658): error (1, -2147483648)
Upvotes: 2