在iOS5的應用爲iPhone 4/4S我有一個UIViewController用的MPMoviePlayerController視圖添加到它的視圖:預防的MPMoviePlayerController旋轉和縮放爲縱向時在全屏
[self.view insertSubview:self.fullscreenMoviePlayerController.view atIndex:2];
的UIViewController中僅支持橫向:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation
{
// Return YES for supported orientations.
return interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight;
}
這正確鎖定旋轉到只有景觀。但是,當我將MPVideoPlayerController設置爲全屏顯示時,忽略此視頻,並且視頻不再受風景限制,並旋轉至手機的任何方向。
如何防止MPMoviePlayerController的視頻旋轉至全屏的縱向方向?當手機旋轉到肖像時,視頻不旋轉至關重要。
我已經嘗試繼承MPVideoPlayerController並覆蓋shouldAutorotateToInterfaceOrientation:
但這沒有效果。
MPMoviePlayerController只是視圖的一部分,所以使用MPMoviePlayerViewCotroller絕對不是一個選項。
你究竟需要什麼,你總是在風景模式下的視頻播放?是的 – Ballu
是的。我需要視頻僅在全屏顯示時才顯示。 – Undistraction
你在iPad或iPhone上工作嗎? – marzapower