从YouTube在Android的播放视频文件

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

我按照有关如何使用YouTube GDATA的教程。填充来自YouTube的视频列表视图和的onclick从stackoverflow

I have followed a tutorial on how to use the youtube gdata. Populating a listview with videos from youtube and a onclick from stackoverflow

但还是在YouTube上的视频播放里面没有我的申请。请帮我找到这个。

But still video play on youtube not inside my application. Please help me to find this.

推荐答案

一旦你得到了你管网址...,从Url.See子串VIDEO_ID下面的例子中我已经给了。

Once you get the You tube url..., Substring the Video_ID from the Url.See the example below i have given.

您可以使用gdata.youtube/feeds/mobile/videos/VIDEO_ID API从实际你管url.data为在 XML格式的rtsp链接

You can use gdata.youtube/feeds/mobile/videos/VIDEO_ID api to get the rtsp link from the actual you tube url.Data is in XML format

一旦你的rtsp链接,你可以在VideoView的这里是的例子

once you get the rtsp link you can play video in VideoView here is the example

例如:   如果这个环节是视频 www.youtube/watch?v=sMM0R19IisI

For example: If this link is the video www.youtube/watch?v=sMM0R19IisI

然后 sMM0R19IisI 是Video_ID.So你可以通过这个视频ID上面API来获取rtsp链接

Then sMM0R19IisI is the Video_ID.So you can pass this video id to above api to get the rtsp link

要取得 JSON格式的数据使用gdata.youtube/feeds/mobile/videos/"+videoid+"?alt=json

请参考以下两个链接:

链接1

链路2

在你在 VideoView

更多推荐

从YouTube在Android的播放视频文件

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

发布评论

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

>www.elefans.com

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