【问题标题】:MPMoviePlayerController: unable to switch from fullscreen to embeddedMPMoviePlayerController:无法从全屏切换到嵌入式
【发布时间】:2011-09-19 06:36:59
【问题描述】:

我有一个带有嵌入视频的纵向视图。将方向更改为横向时,MPMovieplayerController 成功切换到全屏,但当更改回纵向时,它仍处于全屏模式。导航栏为旋转动画闪烁,但视频保持(纵向)全屏模式。

我错过了什么吗?

- (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;
    }

}

提前致谢!

【问题讨论】:

标签: orientation mpmovieplayercontroller fullscreen


【解决方案1】:

解决了这个问题。我使用了似乎与 setFullscreen 不兼容的 MPMovieControlStyleFullscreen。使用 MPMovieControlStyleEmbedded 它可以正常工作...奇怪(错误?)。

【讨论】:

    猜你喜欢
    • 2011-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多