Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing youtube videos on iOS

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

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

like image 436
ahoff Avatar asked Feb 24 '13 12:02

ahoff


People also ask

Why can't I play YouTube videos on my iPhone?

YouTube appTurn off your mobile data connection and then turn it on again. Uninstall and reinstall the YouTube app. Update to the newest available version of the YouTube app. Update to the newest available version of iOS.

How can I play YouTube while in another app iOS?

To use picture-in-picture (PiP), exit the YouTube app while a video is playing. If you have the PiP setting turned on, the video will shrink into a PiP window. The PiP window can be dragged to different parts of the screen, allowing playback to continue on top of other apps.


1 Answers

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.

like image 73
lxt Avatar answered Sep 24 '22 06:09

lxt