如何在Android中播放URL中的视频?没有新的意图吗?可以吗? 感谢
答案 0 :(得分:0)
试试这个
String url="your video url";
VideoView videoView = new VideoView(this);
videoView.setVideoURI(Uri.parse(url));
setContentView(videoView);
videoView.setMediaController(new MediaController(this));
希望帮助
答案 1 :(得分:0)
试试这段代码......它应该可以正常工作。
VideoView videoView = (VideoView) findViewById(R.id.video_view);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
String link = "http://www.youtube.com/watch?v=lEbxLDuecHU&playnext=1&list=PL040F3034C69B1674";
Uri videoLink = Uri.parse(link);
videoView.setMediaController(mediaController);
videoView.setVideoURI(videoLink);
videoView.start();