我有一个只能在竖屏模式下运行的iPhone应用。但是我想让mpmovieplayer只能在横屏模式下播放视频。
我该如何实现呢?
这里是代码:
NSString *path = [[NSBundle mainBundle] pathForResource:lblVideoName.text ofType:@"mp4" inDirectory:nil];
NSURL *url = [[NSURL alloc] initFileURLWithPath:path];
NSLog(@"URL== %@",url);
moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:url];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];