how to play video from url

前端 未结 9 1895
别那么骄傲
别那么骄傲 2020-11-29 03:56

I am beginner in android development and try to play video from link. But it\'s giving error \"sorry,we can\'t play this video\". I tried so many links but for

9条回答
  •  孤城傲影
    2020-11-29 04:42

    It has something to do with your link and content. Try the following two links:

        String path="http://www.ted.com/talks/download/video/8584/talk/761";
        String path1="http://commonsware.com/misc/test2.3gp";
    
        Uri uri=Uri.parse(path1);
    
        VideoView video=(VideoView)findViewById(R.id.VideoView01);
        video.setVideoURI(uri);
        video.start();
    

    Start with "path1", it is a small light weight video stream and then try the "path", it is a higher resolution than "path1", a perfect high resolution for the mobile phone.

提交回复
热议问题