Android VideoView MediaPlayer OnInfoListener - events not fired

后端 未结 7 1269
借酒劲吻你
借酒劲吻你 2021-01-12 04:51

this following source code snippet is given:

videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        @Override
        public void onP         


        
7条回答
  •  悲哀的现实
    2021-01-12 05:44

    You can able to set OnPreparedListener on videoView because its your object but if you checkout source of VideoView you will find that mMediaPlayer is its private member so any change that you do from external will not be applied to it.

    As per your requirement you need buffering status so you can have thread or handler or some thing so you can update your UI to get buffer status there is one method

    int percent = videoView.getBufferPercentage();
    
    if(percent == 100){
    // buffering done 
    } 
    

提交回复
热议问题