Streaming video with videoview

后端 未结 4 937
甜味超标
甜味超标 2020-12-29 16:50

My code below to streaming video:

VideoView vv = (VideoView)this.findViewById(R.id.screen_video);
Uri uri = Uri.parse(URL);
vv.setVideoURI(uri);
vv.start();
         


        
4条回答
  •  长发绾君心
    2020-12-29 17:11

    You shouldn't play the video instantly. Add OnPrepared listener to the video view and start the video playing after it. With MediaPlayer you could keep track of the buffering state and stop the video for a while when its not yet downloaded. Please have a look at this guide.

提交回复
热议问题