VideoView onResume loses buffered portion of the video

后端 未结 10 534
北恋
北恋 2020-12-01 02:56

I am having an Activity in which there is

  1. VideoView -- Streams a video from a webserver.

  2. Button -- Takes the user to the next activit

10条回答
  •  一生所求
    2020-12-01 03:33

    public class Video_play extends Activity {
        VideoView vv;
       String URL;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            setContentView(R.layout.play_video);
            URL= getIntent().getStringExtra("URL");
    
            vv=(VideoView)findViewById(R.id.videoView1);
            MediaController mediaController = new MediaController(this);
            mediaController.setAnchorView(vv);
            Log.v("URL",URL);
    
    
    //       Uri uri = Uri.parse(URL);
    //        vv.setVideoURI(uri);
            vv.setMediaController(new MediaController(this));
            vv.setVideoPath(URL);
    
    //        vv.requestFocus();
    //       
    //        vv.start();
    
    
    //      Uri uri=Uri.parse(URL);
    //
    //    
    //      vv.setVideoURI(uri);
            vv.start();
        }
    

提交回复
热议问题