I am making a application which support only Portrait mode.here iam loading youtube videos in uiwebview. so when i switch to landscape mode video has to play in landscape mode also. But after taping on done of videoplayer. my view controller is changing to landscape mode but it has be in portrait mode only here is my webview code
web=[[UIWebView alloc]initWithFrame:CGRectMake(2,0, 140, 99)];
web.backgroundColor=[UIColor redColor];
[web setDataDetectorTypes: UIDataDetectorTypeNone];
NSString *embedHTML = @"<iframe title=\"YouTube video player\" width=\"320\" height=\"460\" scrolling=\"no\" src=\"http://www.youtube.com/embed/%@?modestbranding=1&rel=0;autoplay=1;showinfo=0;loop=1;autohide=1\" frameborder=\"0\" allowfullscreen allowTransparency=\"true\"></iframe>";
NSString *htmlStr = [NSString stringWithFormat:embedHTML, [youtubeId_array objectAtIndex:i]];
web.tag=i+100;
web.scrollView.bounces=NO;
[web loadHTMLString:htmlStr baseURL:nil];
[view addSubview:web];
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return ( toInterfaceOrientation=UIInterfaceOrientationPortrait);
}