Android Video Streaming using Video View (video view not showing automatially)

前端 未结 1 1068
傲寒
傲寒 2021-01-25 16:51

I have managed to stream video from internet using Video View

  Uri uri=Uri.parse(videoFileList[0]);
    VideoView vv=(VideoView) this.findViewById(R.id.vv);

           


        
相关标签:
1条回答
  • 2021-01-25 17:50

    Try this. It worked for me.

    void playvideo(String url) 
    {
        String  link=url;
        Log.e("url",link);
        view1 = (VideoView) findViewById(R.id.myVideoView); 
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        MediaController mc = new MediaController(this); 
        mc.setMediaPlayer(view1); 
        view1.setMediaController(mc); 
        view1.setVideoURI(Uri.parse(link)); 
        view1.requestFocus(); 
        view1.start();
    }
    
    0 讨论(0)
提交回复
热议问题