mediaPlayer.setEventListener(new MediaPlayer.EventListener() {
@Override
public void onEvent(MediaPlayer.Event event) {
if (event.type == MediaPlayer.Event.Buffering) {
GoockrLog.Loge("aaaaaaaaaaaaaaaa Buffering " + event.getBuffering());
}
}
});
event.getBuffering() 就是缓冲百分比 100代表缓冲完成
配合
ArrayList<String> options = new ArrayList<String>();
// options.add(":file-caching=1500");
options.add("--file-caching=10000");//文件缓存
options.add("--network-caching=10000");//网络缓存
options.add("--live-caching=10000");//直播缓存
options.add("--sout-mux-caching=10000");//输出缓存
// options.add(":codec=mediacodec,iomx,all");
// options.add(":demux=h264");
// options.add("--network-caching=10000");
libVLC = new LibVLC(context, options);
设置缓冲时间
如需要VLC AAR 请移步 https://download.csdn.net/download/u013241923/10588295