我正在尝试从我的 VideoView 中的 URL 播放 youtube 视频,但我收到“无法播放视频错误”,下面是我的代码,我做错了什么?
public class YoutubeVideoPopUpActivity extends Activity {
private String url;
private VideoView videoView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube_video);
final Intent intent = getIntent();
//url = intent.getStringExtra("Url");
url = "http://www.youtube.com/watch?v=INu_z8Zn2R8";
setUpVideo();
}
private void setUpVideo() {
videoView = (VideoView) findViewById(R.id.videoView);
videoView.setMediaController(new MediaController(this));
videoView.setVideoURI(Uri.parse(url));
}
@Override
protected void onResume() {
super.onResume();
videoView.start();
}
}