iOS SDK 中的 YouTube 集成 [英] Youtube integration in iOS SDK

查看:23
本文介绍了iOS SDK 中的 YouTube 集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 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屋!

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