开发者

recv failed (errno = 11) in Streaming App (MediaPlayer) on Nexus

开发者 https://www.devze.com 2023-01-15 11:36 出处:网络
On Nexus devices, my streaming app sometimes stops with: 09-08 11:01:34.640: ERROR/HTTPStream(34): recv failed, errno = 11 (Try

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号