What is MediaPlayer.OnInfoListener “code 703”?

本小妞迷上赌 提交于 2019-12-08 19:20:51

问题


I am running a stream via MediaPlayer. When buffering starts, the code 701 is thrown. When buffering ends, the code 702 is thrown.

All codes are found on this link.

However, MediaPlayer.OnInfoListener first throws the code 703, which I cannot find anywhere. Here is the code and debug output.

mPlayer.setOnInfoListener(new MediaPlayer.OnInfoListener() {
    @Override
    public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
       Log.d(TAG, "MediaPlayer.OnInfoListener: " + i);
        return false;
    }
});

Logcat:

12-29 13:40:54.995: DEBUG/StreamingService(13811): MediaPlayer.OnInfoListener: 703
12-29 13:40:55.000: DEBUG/StreamingService(13811): MediaPlayer.OnInfoListener: 701
12-29 13:41:09.055: DEBUG/StreamingService(13811): MediaPlayer.OnInfoListener: 702
12-29 13:41:10.770: DEBUG/StreamingService(13811): MediaPlayer.OnCompletionListener

What is the code 703 thrown via MediaPlayer.OnInfoListener?


回答1:


Code 703 ought to be MEDIA_INFO_NETWORK_BANDWIDTH : "Bandwidth in recent past" (source).

This isn't really an error. It's a status code for information about what's going on in the media framework. Looking at the AwesomePlayer source code I see that it sends out MEDIA_INFO_NETWORK_BANDWIDTH if the stream data cache is running low, which would eventually happen if you suddenly disable the internet connection. It'll then pause playback and start trying to buffer some more data, which is indicated by a MEDIA_INFO_BUFFERING_START message (code 701).



来源:https://stackoverflow.com/questions/14081894/what-is-mediaplayer-oninfolistener-code-703

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!