Categories
Featured iPhone Development Resources iOS Development Libraries Open Source iOS Libraries And Tools

Open Source: Library For Easily Playing A Youtube Video In An MPMoviePlayer

Embedding Youtube videos within your apps is typically done with a UIWebView, but it is possible to do play Youtube videos within an MPMoviePlayer.

The trick is getting to the MP4 video file provided by Youtube, and I’ve come across a library that does this automatically for a provided URL.

You simply need to specify the URL, and size of the player using this library where you would otherwise be using a UIWebView to play the videos, and if the MP4 file can’t be reached a UIWebView is used.

Included with the library is a working example.

You can find the library known as PSYoutubeExtractor on Github here.

The library is from Peter Steinberger who also created the excellent stacking iPad UIViewController and Push Pop Press style view libraries that have been mentioned previously.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.