我目前使用的MPMoviePlayerController並添加它以一個的UIViewController我敢用呈現:解聘的MPMoviePlayerController,模式上RootViewController的iOS6的
UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
[rootViewController presentModalViewController:viewController animated:YES];
當我使用駁回modalviewcontroller:
UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
[rootViewController dismissModalViewControllerAnimated:YES];
一切都保持黑色。
這在iOS5上運行良好。另一個沒有使用電影播放器的modalviewcontroller仍然在iOS6上罰款。
我試過了[self.view.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
函數,但是這並沒有改變任何東西。
我把它放在另一個視圖中的原因是因爲視圖需要保持肖像,但視頻可能在橫向。我已經通過在iOS6中添加「去/退出全屏」觀察者來修復它。 iOS6中的視頻仍會全屏顯示,但不會以縱向模式播放。不完全是我想要的,但它會做。 – Thomas
嗯......好吧,請注意,如果您以模態方式呈現視圖控制器,則可以確定它所處的方向,而與應用程序其餘部分的方向無關。例如,在iOS 6中,我認爲這是通過'preferredInterfaceOrientationsForPresentation'完成的。據我所知,你可以讓視頻旋轉到肖像和風景,同時保持你的應用程序的其餘部分鎖定在肖像(這聽起來像你想要的,但它不完全清楚)。 –