I came across an issue in my current project, so I spun up a simple app to see if I could isolate the problem. In my app delegate I hide the status bar.
[application setStatusBarHidden:YES animated:NO];
In my single view controller I have this code:
- (void)loadVideo
{
// HTML to embed YouTube video
NSString *youTubeVideoHTML = @"<html><head>\
<body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
// Populate HTML with the URL and requested frame size
NSString *html = [NSString stringWithFormat:youTubeVideoHTML, @"http://www.youtube.com/watch?v=VDRoBnL1gRg", 500, 500];
// Load the html into the webview
[self.webview loadHTMLString:html baseURL:nil];
}
The app is also set to autorotate.
Now, here's the problem: When I play the youtube video, enter fullscreen mode, rotate the device 90 degrees, and hit "Done" to exit fullscreen, the entire interface remains shifted down 20px as if it were accommodating a status bar. I noticed that when viewing a video in full screen, ios adds a status bar, so I'm guessing that's part of the issue. I've seen the problem occur with the native video player as well.
Any ideas?