Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is MediaPlayer.OnInfoListener "code 703"?

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?

like image 341
sandalone Avatar asked Dec 29 '12 12:12

sandalone


1 Answers

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).

like image 77
Michael Avatar answered Nov 01 '22 21:11

Michael