i have a portrait view with an embedded video. When changing orientation to landscape, the MPMovieplayerController successfully switsches to fullscreen, but when changing back to portrait, it stays in fullscreen mode. The navigation bar flashes up for the rotation animation, but the video stays in (portrait-)fullscreen mode.
Do i miss something here?
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
m_player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:self.selectedVideo.videoHighURL ]];
m_player.scalingMode = MPMovieScalingModeAspectFit;
m_player.controlStyle = MPMovieControlStyleFullscreen;
m_player.view.frame = m_videoView.frame;
[m_videoView addSubview:m_player.view];
[m_player play];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
switch (toInterfaceOrientation) {
case UIInterfaceOrientationPortraitUpsideDown:
break;
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
if (NO == m_player.fullscreen) {
[m_player setFullscreen:YES animated:YES];
}
break;
case UIInterfaceOrientationPortrait:
[m_player setFullscreen:NO animated:YES];
break;
default:
break;
}
}
Thanks in advance!