2012-09-27 59 views
2

我在我的應用程序中有MPMoviePlayerViewController,我正在使用它來全屏播放視頻。IOS 6 - 播放視頻後不顯示狀態欄

這適用於iPad上的IOS 5操作系統。

但是在iPad 3上的iOS 6上,播放視頻之後,狀態欄消失並被白色空間替換。

是否馬虎使用[[UIApplication sharedApplication]setStatusBarHidden:NO]; 恢復狀態欄到處都有視頻?

由於我的應用程序非常龐大,任何人都可以提供替代方法嗎?

回答

1

我遇到同樣的問題,似乎還有一些問題與iOS 6使用時 MPMovieControlStyleEmbededFullScreen = YES 它可能無法播放視頻或調用播放器的兩倍,這就造成了一些框架的定位問題。

我最終不得不改變整個應用程序使用presentMoviePlayerViewControllerAnimated從中似乎視圖控制器將在這個新的iOS播放視頻更合適的方式6

MPMoviePlayerController fullscreen mode issue

+0

感謝您的建議。 –

+1

你可以請檢查了這一點,並找到這個問題的解決方案也http://stackoverflow.com/questions/12725941/ios-6-issue-with-mpmovieplayercontroller –

3

我增加了一個觀察員MPMoviePlayerDidExitFullscreenNotification。在這個觀察者中,我創建了一個NSTimer在兩秒鐘後開始。在NSTimer觸發的消息中,我重置狀態欄樣式以及狀態欄。定時器是必需的,因爲我注意到狀態欄在退出全屏完成的動畫之後進入了不一致的狀態。

其中管理MPMoviePlayer的視圖控制器

所以,我做了以下內容:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerDidExitFullScreenCallback:) name:MPMoviePlayerDidExitFullscreenNotification object:self.moviePlayerController]; 

然後通知選擇中:

- (void) moviePlayerDidExitFullScreenCallback:(NSNotification *)aNotification { 

    [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(setStatusBarVisible:) userInfo:nil repeats:NO]; 

} 

的setStatusBarVisible選擇和內:

- (void) setStatusBarVisible: (NSTimer *)timer { 
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque]; 
    [[UIApplication sharedApplication] setStatusBarHidden:NO]; 
} 
+0

謝謝Kapsico。 。 。 –