1

我的問題是,我有一個MPMoviePlayerViewController嵌入在一個modalviewcontroller有一個表格屬性,當視頻去全屏使用捏或控件不工作的箭頭。UIModalPresentationFormSheet中的MPMoviePlayerViewController問題

我已經知道,他們不工作,因爲只有在矩形內使modalviewcontroller被註冊。例如,雙擊可放大矩形作品的內部,而其他任何地方都不會。

這是一個問題,因爲由於這個問題無法使用電影控件。誰能幫忙?

+0

我終於明白了。它只在裏面工作,因爲電影播放器​​在模態視圖內,只允許在視圖內部進行交互。該視頻完全全屏顯示,因此交互只發生在模態視圖所在的位置。爲了解決這個問題,我使用電影播放器​​通知在進入全屏和退出全屏時更改了模式視圖大小。 – Pete42 2011-06-23 05:47:57

回答

1

這是我如何解決它。當視頻進入全屏模式時,我改變了模態視圖控制器的大小。

- (無效)movieDidEnterFullscreen:(NSNotification *)通知{

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; 

}

- (無效)movieDidExitFullscreen:(NSNotification *)通知{

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; 

}

相關問題