In my project I use embeded view, which has MPMoviePlayerController inside.
This movie player stops working after tapping full screen toggle - it plays 1 more second in full screen mode and then stops and turns back to the inline mode.
It happens only in portrait mode and only for iOS 7 - if I switch on full screen mode with landscape orientation and then rotate the device, it works alright.
I've found the reason - somehow navigation bar is involved. I use ECSlidingViewController in the project and set up navigation bar translucent "NO" during the initialization:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myViewController];
navController.navigationBar.translucent = NO;
self.topViewController = navController;
If I set up navController.navigationBar.translucent = YES;
the movie player works fine. But I have to have translucent = NO.
So I've tried to play with the movie players events MPMoviePlayerWillEnterFullscreenNotification and MPMoviePlayerWillExitFullscreenNotification. It's interesting that if I make navBar translucent or hide it before entering full screen mode, the video plays a little bit longer (around 3-4 seconds) but then the behavior is the same.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayerWillEnterFullScreen:)
name:MPMoviePlayerWillEnterFullscreenNotification
object:nil];
-(void)moviePlayerWillEnterFullScreen:(id)sender{
[self.navigationController setNavigationBarHidden:YES animated:NO];
OR
self.navigationController.navigationBar.translucent = YES;
}
Any ideas what I can do with this are much appreciated.
UPD. This bug is gone in iOS 7.0.4
drawRect:
code forUINavigationBar
, correct? – Till