I want to play the youtube video in my app. I have tried all the different way but not able to play video. Video that are not playing
http://www.youtube.com/watch?v=uuZE_IRwLNI
http://www.youtube.com/watch?v=FyXtoTLLcDk
1. Simple load request with UIWebView
it fail with Error
NSURL *url = [NSURL URLWithString:@"http://www.youtube.com/watch?v=fDXWW5vX-64"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:request];
**Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed.**
2. Embedding youtube Video
NSString* embedHTML = [NSString stringWithFormat:@"\
<html>\
<body style='margin:0px;padding:0px;'>\
<script type='text/javascript' src='http://www.youtube.com/iframe_api'></script>\
<script type='text/javascript'>\
function onYouTubeIframeAPIReady()\
{\
ytplayer=new YT.Player('playerId',{events:{onReady:onPlayerReady}})\
}\
function onPlayerReady(a)\
{ \
a.target.playVideo(); \
}\
</script>\
<iframe id='playerId' type='text/html' width='%d' height='%d' src='http://www.youtube.com/embed/%@?enablejsapi=1&rel=0&playsinline=1&autoplay=1' frameborder='0'>\
</body>\
</html>", 300, 200, @"uuZE_IRwLNI"];
[self.webView loadHTMLString:embedHTML baseURL:[[NSBundle mainBundle] resourceURL]];
Here its just keep loading not able to play
3. Extracting Video URL
LBYouTubeExtractor* extractor = [[LBYouTubeExtractor alloc]initWithID:[self getVideoID] quality:1];
extractor.delegate = self;
[extractor startExtracting];
But here is same reasult