Pages

Thursday 23 August 2012

Stream Youtube in iOS App: Using HTML & JS

As usual its a "follow the steps" kind of post:
Lets use JWPlayer to stream youtube in iOS :).

Download the JWPlayer files from here.
Now open a new project in xcode as "Single View Application".

Now go to ViewController.xib and add a new webView in it.

Connect this webView to viewController.h and name it as player.




Now add the JWPlayer code to our project, exactly as shown in the image.

Note: "Create Folder Reference To Any Folder Added" must be selected or you simply hit the wall. As you wish :).

Now add the following code to "ViewDidLoad" method:

 NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"readme" ofType:@"html" inDirectory:@"mediaplayer-5.10-viral"]];
  [player loadRequest:[NSURLRequest requestWithURL:url]];



Thats it. :)

No comments:

Post a Comment