java – 无法从android appf中的youtube api检索到优质视频网址
发布时间:2020-12-15 02:28:45 所属栏目:Java 来源:网络整理
导读:从youtube api我得到这三个视频播放网址,但没有一个在移动设备上为我提供高质量的视频输出.我从用户上传中获取此信息. entryidhttp://gdata.youtube.com/feeds/api/videos/tLEpHDsQhCw/idpublished2011-07-16T20:35:17.000Z/publishedupdated2011-10-17T12:2
从youtube api我得到这三个视频播放网址,但没有一个在移动设备上为我提供高质量的视频输出.我从用户上传中获取此信息.
<entry> <id>http://gdata.youtube.com/feeds/api/videos/tLEpHDsQhCw</id> <published>2011-07-16T20:35:17.000Z</published> <updated>2011-10-17T12:25:11.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video' /> <category scheme='http://gdata.youtube.com/schemas/2007/categories.cat' term='Music' label='Music' /> <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Attaullah Khan Esakhelvi' /> <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Coke Studio' /> <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Season 4' /> <title type='text'>Attaullah Khan Esakhelvi,Coke Studio,Season 4 </title> <content type='text'>Coke Studio Sessions. Produced by Rohail Hyatt. </content> <link rel='alternate' type='text/html' href='https://www.youtube.com/watch?v=tLEpHDsQhCw&feature=youtube_gdata' /> <link rel='http://gdata.youtube.com/schemas/2007#video.responses' type='application/atom+xml' href='https://gdata.youtube.com/feeds/api/videos/tLEpHDsQhCw/responses' /> <link rel='http://gdata.youtube.com/schemas/2007#video.related' type='application/atom+xml' href='https://gdata.youtube.com/feeds/api/videos/tLEpHDsQhCw/related' /> <link rel='http://gdata.youtube.com/schemas/2007#mobile' type='text/html' href='https://m.youtube.com/details?v=tLEpHDsQhCw' /> <link rel='self' type='application/atom+xml' href='https://gdata.youtube.com/feeds/api/users/cokestudio/uploads/tLEpHDsQhCw' /> <author> <name>cokestudio</name> <uri>https://gdata.youtube.com/feeds/api/users/cokestudio</uri> </author> <gd:comments> <gd:feedLink href='https://gdata.youtube.com/feeds/api/videos/tLEpHDsQhCw/comments' countHint='6' /> </gd:comments> <yt:hd /> <yt:location>Karachi</yt:location> <media:group> <media:category label='Music' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Music</media:category> <media:content url='https://www.youtube.com/v/tLEpHDsQhCw?version=3&f=user_uploads&app=youtube_gdata' type='application/x-shockwave-flash' medium='video' isDefault='true' expression='full' duration='226' yt:format='5' /> <media:content url='rtsp://v3.cache5.c.youtube.com/CigLENy73wIaHwkshBA7HCmxtBMYDSANFEgGUgx1c2VyX3VwbG9hZHMM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='226' yt:format='1' /> <media:content url='rtsp://v1.cache5.c.youtube.com/CigLENy73wIaHwkshBA7HCmxtBMYESARFEgGUgx1c2VyX3VwbG9hZHMM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='226' yt:format='6' /> <media:description type='plain'>Coke Studio Sessions. Produced by Rohail Hyatt.</media:description> <media:keywords>Attaullah Khan Esakhelvi,Season 4 </media:keywords> <media:player url='https://www.youtube.com/watch?v=tLEpHDsQhCw&feature=youtube_gdata_player' /> <media:thumbnail url='http://i.ytimg.com/vi/tLEpHDsQhCw/0.jpg' height='360' width='480' time='00:01:53' /> <media:thumbnail url='http://i.ytimg.com/vi/tLEpHDsQhCw/1.jpg' height='90' width='120' time='00:00:56.500' /> <media:thumbnail url='http://i.ytimg.com/vi/tLEpHDsQhCw/2.jpg' height='90' width='120' time='00:01:53' /> <media:thumbnail url='http://i.ytimg.com/vi/tLEpHDsQhCw/3.jpg' height='90' width='120' time='00:02:49.500' /> <media:title type='plain'>Attaullah Khan Esakhelvi,Season 4</media:title> <yt:duration seconds='226' /> </media:group> <gd:rating average='4.928571' max='5' min='1' numRaters='56' rel='http://schemas.google.com/g/2005#overall' /> <yt:recorded>2011-07-17</yt:recorded> <yt:statistics favoriteCount='34' viewCount='13122' /> </entry> VideoView vv = (VideoView) findViewById(R.id.vv); MediaController mc = new MediaController(this); mc.setEnabled(true); mc.show(0); vv.setMediaController(mc); vv.setVideoURI(Uri.parse("rtsp://v1.cache5.c.youtube.com/CigLENy73wIaHwkshBA7HCmxtBMYESARFEgGUgx1c2VyX3VwbG9hZHMM/0/0/0/video.3gp")); vv.requestFocus(); vv.start(); 我正在使用这个java代码来访问和播放视频 提前致谢 解决方法
目前的建议是在您的应用程序中使用
Player以内的
Player.
在未来的某个时刻,我们计划发布可以处理YouTube播放的原生Android视图,如此Google I / O 2012会话所述:https://developers.google.com/events/io/sessions/gooio2012/120/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |