在android中播放来自youtube的视频文件

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

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

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

解决方案

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

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

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

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

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

To get Data in JSON format use this gdata.youtube/feeds/mobile/videos/"+videoid+"?alt=json

Refer these two links:

Link1

Link2

Once you get the rtsp link you can play it in VideoView

更多推荐

在android中播放来自youtube的视频文件

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

发布评论

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

>www.elefans.com

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