【问题标题】:MPMoviePlayerViewController in UIModalPresentationFormSheet ProblemUIModalPresentationFormSheet 中的 MPMoviePlayerViewController 问题
【发布时间】:2011-03-05 21:30:03
【问题描述】:

我的问题是我有一个 MPMoviePlayerViewController 嵌入在具有表单属性的 modalviewcontroller 中,当视频使用捏合或箭头进入全屏时,控件不起作用。

我发现它们不起作用,因为只有在使 modalviewcontroller 注册的矩形内进行触摸。例如,双击以在矩形内进行缩放可以正常工作,而在其他任何地方都不能。

这是一个问题,因为该问题导致无法使用电影控件。有人可以帮忙吗?

【问题讨论】:

  • 我终于想通了。它只能在内部工作,因为电影播放器​​位于模态视图内部,该视图只允许在视图内部进行交互。视频完全全屏播放,因此交互只发生在模态视图所在的位置。为了解决这个问题,我使用电影播放器​​通知更改了进入全屏和退出全屏时的模式视图大小。

标签: iphone ipad mpmovieplayercontroller uimodalpresentationformsh


【解决方案1】:

这是我解决它的方法。当视频进入全屏模式时,我更改了模态视图控制器的大小。

-(void)movieDidEnterFullscreen:(NSNotification *)notification{

NSLog(@"did enter");

self.navigationController.view.superview.frame = CGRectMake(0, 0, 1500,1500);

self.navigationController.view.superview.center = self.view.center;

[mpviewController moviePlayer].controlStyle = MPMovieControlStyleDefault;

}

-(void)movieDidExitFullscreen:(NSNotification *)notification{

NSLog(@"did exit");

UIDevice *device = [UIDevice currentDevice];
[device beginGeneratingDeviceOrientationNotifications];

if (([device orientation] == UIDeviceOrientationLandscapeLeft) || ([device orientation] == UIDeviceOrientationLandscapeRight)){
    self.navigationController.view.superview.frame = CGRectMake(0, 0, 620,540);
    self.navigationController.view.superview.center = CGPointMake(384, 512);
}

else {

    self.navigationController.view.superview.frame = CGRectMake(0, 0, 540,620);
    self.navigationController.view.superview.center = CGPointMake(384, 512);

}


[mpviewController moviePlayer].controlStyle = MPMovieControlStyleEmbedded;

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-06
    • 2011-11-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多