2016-11-15 59 views
0

我有一個視頻流在我的應用程序,我想像youtube播放器一樣工作。這意味着當視頻播放器處於全屏狀態並且設備處於橫向模式時,旋轉到端口速率時,我想將視頻播放器的全屏設置關閉。要做到這一點我編碼如下:MPMoviePlayer setFullscreen函數不工作 - swift

override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { 
    if toInterfaceOrientation == .Portrait 
    { 
     self.moviePlayer.setFullscreen(false, animated: true) 
    } 
} 

但當我旋轉設備,它仍然在全屏模式。我如何強制電影播放器​​退出全屏方向?

回答

-1
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    return YES; 
} 
+0

如何解決這個問題? :/ –