可以在 wp7 应用程序中播放 Youtube 视频吗? [英] Possible to play Youtube video in a wp7 app?

查看:22
本文介绍了可以在 wp7 应用程序中播放 Youtube 视频吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 wp7 应用程序中播放 youtube 视频?我猜你可以从 youtube api 中检索视频文件,也许可以使用媒体元素播放它?任何建议、提示或资源将不胜感激.

is it possible to play youtube videos in a wp7 application? I would guess you could retrieve the video file from the youtube api and Perhaps play it using a media element? Any suggestion, tips or resources would be appreciated.

推荐答案

这是一个很好的问题,确实触及了 YouTube 商业模式、YouTube 的 API 和 WP7 集成的核心.

That's a great question and really goes to the heart of YouTube's business model, YouTube's API and WP7 Integration.

简短回答:在有限的范围内,可以在 WP7 中播放低质量视频.

Short answer: To a limited extend it could be possible to play low-quality videos in WP7.

您应该问自己的第一个问题是:什么是 Google?"答案是一家广告服务公司".绝大多数谷歌&YouTube 的收入来源完全来自广告.如果您在没有任何 YouTube 品牌或广告的情况下获取 YouTube 的内容并在您自己的网站/应用程序上提供它,那将与他们的金融业务模式背道而驰.

The first question you should ask yourself is: "What is Google?" The answer is "An Ad serving company". The overwhelming majority of Google & YouTube's revenue stream comes exclusively from advertisements. If you were to take YouTube's content and serve it on your own website/app without any YouTube branding or ads, that would works against their financial business model.

您应该问自己的第二个问题是:那么 iPhone 是如何显示 YouTube 视频的?还有 WP7?还是 YouTube 网站本身呢?".这是 YouTube 媒体传输系统的核心.YouTube 从其网站公开公开多种格式.例如格式#1 是H263,格式#6 是MPEG,格式#5 是SWF/FLV 内容.您可以在官方文档中详细了解 YouTube 格式.

The second question you should ask yourself is: "So how is iPhone showing YouTube videos? And WP7? Or YouTube website itself for that matter?". This goes into the heart of YouTube's media delivery system. YouTube publicly exposes multiple formats from their website. For example format #1 is H263, Format #6 is MPEG and Format #5 is the SWF/FLV content. You can read more about YouTube Formats in their official documentation.

现在,回答你的问题.YouTube API 仅向未经授权的第 3 方和第三方公开缩略图大小的视频可能会显示在 WP7 应用内.然而,如果放大到 WP7 屏幕分辨率的 1/4 以上,视频质量会很糟糕.

And now, to answer your question. YouTube API only exposes thumbnail size videos for unauthorized 3rd parties and those could potentially be showed in WP7 in-app. However the video quality will be terrible if scaled up for more than 1/4 of the WP7 screen resolution.

我建议您通读 GData YouTube 开发者指南以获取信息在 API 上.我将快速介绍如何访问这些公共视频.就个人而言,我没有成功地让这些 3GP 视频在 WP7 上工作.

I suggest you read through the GData YouTube developer guide for information on the API. I'll do a quick run-through of how to get to those public videos. Personally, I haven't been successful in getting these 3GP videos to work on WP7.

  1. 打开评分最高的视频的 GData 供稿:http://gdata.youtube.com/feeds/api/standardfeeds/top_rated

来自 <entry/> 元素找到 <id/> 元素,它应该有一个链接到单个视频 GData 供稿.我拿起了这个:http://gdata.youtube.com/feeds/api/videos/dMH0bHeiRNg

from the < entry /> element find the < id /> element which should have a link to single video GData feed. I picked up this one: http://gdata.youtube.com/feeds/api/videos/dMH0bHeiRNg

找到 <带有 yt:format 属性的 media:content/> 元素.

find the < media:content /> elements with yt:format attributes.

yt:format='5'/>

yt:format='1'/>

< media:content url='rtsp://v5.cache7.c.youtube.com/CiILENy73wIaGQnYRKJ3bPTBdBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='360' yt:format='1'/>

yt:format='6'/>

< media:content url='rtsp://v3.cache8.c.youtube.com/CiILENy73wIaGQnYRKJ3bPTBdBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='360' yt:format='6'/>

打开带有格式 #6 URL 的VLC 播放器",您应该会看到 RTSP 流播放器.

Open up "VLC Player" with format #6 URL and you should see the RTSP stream player.

** 整篇文章应被视为据我所知".这是我从 YouTube 官方文档和论坛中学到的所有知识.

** This whole post should be considered "As far as I know". This is all knowledge I gleamed from official YouTube documentation and forums.

这篇关于可以在 wp7 应用程序中播放 Youtube 视频吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆