gpt4 book ai didi

java - 无法从 android appf 中的 youtube api 检索高质量的视频 url

转载 作者:太空宇宙 更新时间:2023-11-03 10:54:32 25 4
gpt4 key购买 nike

我从 youtube api 获得了这三个视频播放 url,但它们都没有给我在移动设备上提供高质量的视频输出。我从用户上传中获取此信息。

<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&amp;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&amp;f=user_uploads&amp;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, Coke Studio, Season 4
</media:keywords>
<media:player
url='https://www.youtube.com/watch?v=tLEpHDsQhCw&amp;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, Coke Studio,
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来自 WebView在您的应用程序中。

在未来的某个时候,我们计划发布可以处理 YouTube 播放的原生 Android View ,如本次 Google I/O 2012 session 所述:https://developers.google.com/events/io/sessions/gooio2012/120/

关于java - 无法从 android appf 中的 youtube api 检索高质量的视频 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7859177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com