在iOS上播放youtube视频

编程入门 行业动态 更新时间:2024-10-21 18:41:49
本文介绍了在iOS上播放youtube视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道McTube( https ://itunes.apple/us/app/mctube-for-youtube/id559618284?mt = 8 )播放youtube视频.看起来像自定义MPMoviePlayerController,但允许吗?

I was wondering how are apps like McTube (itunes.apple/us/app/mctube-for-youtube/id559618284?mt=8) playing youtube videos. It looks like a custom MPMoviePlayerController but is that allowed?

顺便说一句,我需要使用UIWebView无法实现的自动播放功能,这就是我想知道的原因.

BTW I need autoplay which I couldn't achieve with UIWebView, that's why i was wondering.

推荐答案

某些YouTube视频可以在MPMoviePlayerController中播放-有些不能.当您通过YouTube数据API查询视频(链接此处)时,您会获取特定视频的所有可用内容类型,包括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 (link here) 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上播放youtube视频

本文发布于:2023-11-23 14:00:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621691.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视频   iOS   youtube

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!