如果在iPad中的PresentModalViewController上打开,则会出现MPMoviePlayerControler全屏问题

时间:2011-04-03 17:41:48

标签: ipad mpmovieplayercontroller presentmodalviewcontroller

在从presentModalViewController开始以全屏模式打开MPMoviePlayerController时遇到问题。

我打开一个presentModalViewController

//Create controller
mDetailFilmController = [[DetailFilmController alloc]
                                    initWithNibName:@"DetailFilmController" bundle:nil];

UINavigationController *navController = [[UINavigationController alloc]
                                         initWithRootViewController:mDetailFilmController];

//Set modal style
navController.modalPresentationStyle = UIModalPresentationPageSheet;
navController.navigationBar.barStyle = UIBarStyleBlack;

//presentModalViewController
[self presentModalViewController:navController animated:YES];


//Dimension
navController.view.superview.bounds = CGRectMake(0, 0, 700, 700);
在DetailFilmController中有一个MPMoviePlayerController,这是播放按钮的代码:

self.mPlayer = [[MPMoviePlayerController alloc] init];

//set url
self.mPlayer.contentURL = btn.linked_url;

//set dimension
self.mPlayer.view.frame = self.view.frame;

//AddSubView
[self.mViewForMovie addSubview:mPlayer.view];

//Notify
[[NSNotificationCenter defaultCenter]  addObserver:self selector:@selector(_moviePlayerDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:mPlayer];
[[NSNotificationCenter defaultCenter]  addObserver:self selector:@selector(_moviePlayerDidFinish:) name:MPMoviePlayerDidExitFullscreenNotification object:mPlayer];

//fullscreen
[self.mPlayer setFullscreen:YES animated:YES];

//start play
[self.mPlayer play];

当我尝试单击“完成”按钮时出现问题,这不起作用。

只有在下面的presentModalViewController区域才可以拦截点击。

我做错了什么?

感谢您的帮助

0 个答案:

没有答案