I came across the similar problem on my iPhone app.
I wonder if this is the right way but for now the code below solved it.
1. Added observers in the webivew's initialize method.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
The observers should be removed when you don't need them no longer. I just put the code in the webview's dealloc method.
[[NSNotificationCenter defaultCenter] removeObserver:self];
2. Hide the navigation bar when the movie started and show it again when the movie finished.
* contentsViewController in the code is the owner of my webview. so just in my case.
- (void)youTubeStarted:(NSNotification *)notification
{
self.contentsViewController.navigationController.navigationBarHidden = YES;
}
- (void)youTubeFinished:(NSNotification *)notification
{
self.contentsViewController.navigationController.navigationBarHidden = NO;
}
I got the way from How to receive NSNotifications from UIWebView embedded YouTube video playback