1. 程式人生 > >android videoView 加載等待

android videoView 加載等待

log .get visible pub .post clas span etc tde

final Handler handler = new Handler();
Runnable runnable = new Runnable() {
    public void run() {
        int duration = mVideoView.getCurrentPosition();
        if(mVideoView.isPlaying()){
            if (old_duration == duration) {
                mProgressBar.setVisibility(View.VISIBLE);
            } 
else { mProgressBar.setVisibility(View.GONE); } } old_duration = duration; handler.postDelayed(runnable, 500); } };
handler.postDelayed(runnable, 0);

android videoView 加載等待