播放YouTube视频在videoview

编程入门 行业动态 更新时间:2024-10-23 02:10:32
本文介绍了播放YouTube视频在videoview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的应用程序有一个videoview,我想在that.For来播放YouTube视频,我试过很多方法,如

In my application I have a videoview and I want to play youtube videos in that.For that I tried lots of methods like

VideoView mVideoView = new VideoView(this); setContentView(mVideoView); mVideoView.setVideoURI(Uri.parse("rtsp://v3.cache7.c.youtube/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();

下面还我收到了同样的错误。

Here also I am getting the same error.

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("www.youtube/watch?v=GDD0Brw-udk&feature=youtube_gdata_player")));

这让我的应用程序,并开始移动版YouTube,我无法控制。

This leaves my application, and starts the mobile youtube where I have no control.

我用另一种方法是

Intent lVideoIntent = new Intent(null, Uri.parse("www.youtube/get_video_info?&video_id=GDD0Brw-udk") , this, IntroVideoActivity.class); startActivity(lVideoIntent);

这也是不是为我工作。

我应该怎么do..Anyone帮我please..Thanx提前

What should I do..Anyone help me please..Thanx in advance

推荐答案

您code:

VideoView mVideoView = new VideoView(this); setContentView(mVideoView); mVideoView.setVideoURI(Uri.parse("rtsp://v3.cache7.c.youtube/CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp")); mVideoView.start();

是罚款,将工作对我来说只是检查你的网址。

is fine and will work as for me just check your url.

更多推荐

播放YouTube视频在videoview

本文发布于:2023-11-23 13:57:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621679.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视频   YouTube   videoview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!