On Nexus devices, my streaming app sometimes stops with:
09-08 11:01:34.640: ERROR/HTTPStream(34): recv failed, errno = 11 (Try again)
09-08 11:13:45.130: ERROR/HTTPStream(34): recv failed, server is gone, total received: 12272 bytes
The first error is more common. This does 开发者_高级运维not happen on G1 devices.
My code looks like this:
mediaPlayer = new MediaPlayer();
mediaPlayer.setWakeMode(this, PowerManager.PARTIAL_WAKE_LOCK);
mediaPlayer.setOnErrorListener(this);
mediaPlayer.setOnBufferingUpdateListener(this);
new Thread(new Runnable() {
public void run() {
try {
mediaPlayer.setDataSource(getString(R.string.URL));
mediaPlayer.prepare();
mediaPlayer.start();
} catch (IOException e) {
e.printStackTrace(e);
}
}
}).start();
Why does this error occur on Nexus devices?
精彩评论