I have a UIWebView subclass that I used to play both youtube and local videos. Worked perfectly under iOS6. In upgrading to iOS7 I\'ve encountered a problem I don\'t really kn
Using this you can run youtube video in your view..
UIWebView *videoView = [[UIWebView alloc] initWithFrame:self.view.bounds];
NSString *strparse = [NSString stringWithFormat:@"http://www.youtube.com/watch?v=%@",youtubeVideoId];
NSRange rng = [strparse rangeOfString: @"watch?v="];
strparse = [strparse substringFromIndex:rng.location];
rng = [strparse rangeOfString:@"&feature="];
if (rng.length >0)
{
strparse = [strparse substringToIndex:rng.location];
}
strparse = [strparse stringByReplacingOccurrencesOfString:@"watch?v=" withString:@""];
//http://www.youtube.com/embed/FJkiwbqlSy0
NSString *youTubeVideoHTML =[NSString stringWithFormat:@" ",0.0, 0.0,youtubeVideoId];
videoView.scalesPageToFit=NO;
videoView.mediaPlaybackRequiresUserAction=NO;
videoView.backgroundColor = [UIColor clearColor];
videoView.opaque= NO;
[SharedObj showLoadingWithText:@""];
[videoView loadHTMLString:youTubeVideoHTML baseURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.youtube.com/watch?v=%@",youtubeVideoId]]];
[self.view addSubview:videoView];