在我的應用程序有一個videoview,我想在that.For播放YouTube視頻,我試過很多方法,如播放YouTube視頻的videoview
VideoView mVideoView = new VideoView(this);
setContentView(mVideoView);
mVideoView.setVideoURI(Uri.parse("rtsp://v3.cache7.c.youtube.com/CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp"));
mVideoView.start();
對於這個我得到
08-13 12:33:07.443: D/MediaPlayer(618): Couldn't open file on client side, trying server side
08-13 12:33:09.003: E/MediaPlayer(618): error (1, -2147483648)
08-13 12:33:09.003: E/MediaPlayer(618): Error (1,-2147483648)
然後我試圖
VideoView mVideoView = new VideoView(this);
setContentView(mVideoView);
mVideoView.setVideoURI(Uri.parse("vnd.youtube:GDD0Brw-udk"));
mVideoView.start();
這裏也是我收到了同樣的錯誤。
而且
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=GDD0Brw-udk&feature=youtube_gdata_player")));
這讓我的應用程序,並開始移動版YouTube,我無法控制。
我用另一種方法是
Intent lVideoIntent = new Intent(null, Uri.parse("http://www.youtube.com/get_video_info?&video_id=GDD0Brw-udk")
, this, IntroVideoActivity.class);
startActivity(lVideoIntent);
這也是不是爲我工作..
我應該怎麼do..Anyone幫我please..Thanx提前
duplicate http://stackoverflow.com/questions/3815090/webview-and-html5-video – jenuine 2012-08-13 07:37:39