我的问题真的很简单,教程和答案都没有解决我的问题。
我有一个带有设置的应用程序:
我想在我的所有 viewController 中仅支持纵向/颠倒方向,除非我想通过以下方式播放视频:
MPMoviePlayerViewController
代码如下:
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:[Videos videoURL:video.hash]];
if (mp) {
isVideoPlaying = YES;
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(videoFinishedPlaying:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:mp.moviePlayer];
[self presentMoviePlayerViewControllerAnimated:mp];
mp.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[mp.moviePlayer play];
[mp release];
}
当 MPMoviePlayerViewController
播放视频时,我希望支持所有方向。
需要你的帮助。
最佳答案
您应该允许按以下方式轮换:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
}
iOS 6:
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
将代码放在调用播放器的.m文件中
关于ios - 横向/所有方向的 MPMoviePlayerViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14518894/