我希望在视频播放(加载时)视频视图之前有一个进度条(不是进度条dailog)。在不使用onpreparedlistener()的情况下考虑任何其他方法。
答案 0 :(得分:0)
使用此示例在播放vedio http://www.quicktips.in/how-to-show-progressbar-while-loading-a-video-in-android-videoview/
之前显示prograssbar答案 1 :(得分:0)
试试这个,在视频开始播放时调用此方法:
private void bufferingController(){
bufferhandler = new Handler();
bufferhandler.postDelayed(new Runnable() {
@Override
public void run() {
int duration = videoview.getCurrentPosition();
//System.out.println("duration "+duration);
//System.out.println("oldduration = "+old_duration +" duration = "+duration);
if (old_duration == duration ) {
progressBar.setVisibility(View.VISIBLE);
}
else {
progressBar.setVisibility(View.GONE);
}
old_duration = duration;
}
}, 1000);
}