如何在 Android 上获取 RTSP 链接 [英] How to get RTSP Links Android
问题描述
我有像 http://www.youtube.com/v/YR71GnQ4CU4?f=videos&app=youtube_gdata ,那么如何将其转换为RTSP格式以在VideoView中播放.
Am having you-tube links like http://www.youtube.com/v/YR71GnQ4CU4?f=videos&app=youtube_gdata , then how to convert it to RTSP format to play in VideoView.
我正在用这个搜索 gdata api:http://gdata.youtube.com/feeds/api/videos?&max-results=20&v=2&format=1&q="+ URLEncoder.encode(activity.criteria) 但是我找不到如何获取相关的 RTSP 网址.
Am searching gdata api with this: http://gdata.youtube.com/feeds/api/videos?&max-results=20&v=2&format=1&q="+ URLEncoder.encode(activity.criteria) but i cant find how to get related RTSP url.
推荐答案
我得到了答案 ..thanx
I got my answer ..thanx to this
Element rsp = (Element)entry.getElementsByTagName("media:content").item(1);
String anotherurl=rsp.getAttribute("url");
仅在 gdata api 中我们得到这种类型的链接:rtsp://v3.cache7.c.youtube.com/CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp
In gdata api only we are getting this type of links : rtsp://v3.cache7.c.youtube.com/CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp
这些正在 VideoView 中播放.
These are playing in VideoView.
这篇关于如何在 Android 上获取 RTSP 链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!