iOS SDK中的YouTube集成 [英] Youtube integration in iOS SDK
问题描述
如何将Youtube与iOS集成?我主要是想播放私人视频而不要求登录.登录应在应用中进行硬编码,并且在播放私人视频之前不会询问用户.
How I can integrate Youtube with iOS? Mainly I want to play private videos without asking for login. Login should be hard coded in the app and will not ask user before playing the private video.
推荐答案
某些YouTube视频可以在MPMoviePlayerController中播放-有些则不能.通过YouTube数据API查询视频时, https://developers.google.com/youtube /2.0/reference#Videos_feed 您将获得适用于特定视频的所有内容类型,包括Flash播放器,3GPP,MP4(如果有)等.您可以使用这些URL加载MPMoviePlayerController. 完全可以,但是正如我所说-并非所有视频都可以通过这种方式嵌入.某些视频(主要是需要显示广告的视频)无法放入本机控制器中.
Some YouTube videos can be played back in a MPMoviePlayerController - some cannot. When you query a video through the YouTube Data API https://developers.google.com/youtube/2.0/reference#Videos_feed you'll get back all the content types available for a particular videos, including the Flash player, 3GPP, MP4 (if available), etc. You can use these URLs to load up a MPMoviePlayerController. This is perfectly fine, but as I've said - not all videos are available to embed this way. Some videos (mainly ones that require adverts to be displayed) can't be put into native controllers.
这篇关于iOS SDK中的YouTube集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!