Android ijkplayer buffer setting and error resolution after playing for a period of time
Dragging the playback progress of ijkplayer will lead to re requesting data and not using the buffered data, so the buffer size should be controlled as much as possible to reduce unnecessary data loss.
mMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max-buffer-size", 100 * 1024);// Set the buffer to 100kb. In my opinion, the buffer is more than 4 seconds
mMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "min-frames", 100);// Video, set 100 frames to start playing
Resolve the error after playing for a period of time:
mMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "reconnect", 1);// Reconnect mode. If the server is disconnected halfway, let it reconnect. Refer to https://github.com/Bilibili/ijkplayer/issues/445
Reproduced at: https://www.cnblogs.com/justkeepmoving/p/7871745.html