我想在启动应用程序时以横向模式显示MPMoviePlayer。现在它以纵向模式开始。有一些代码强制应用程序在横向模式下启动。但据说这些代码段属于私有API,因此应用商店不会接受该应用程序。自从早上我试图找到一种方式,但没有结果...任何人都可以帮助我吗?风景模式下的iPhone MPMoviePlayer
这是我在哪里:
NSURL * URL = [[NSURL的alloc] initWithString:urlString];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(videoPlayerPlaybackStateChanged:)
name:MPMoviePlayerPlaybackStateDidChangeNotification
object:nil];
[self setWantsFullScreenLayout:YES];
[moviePlayer prepareToPlay];
//For viewing partially.....
moviePlayer.view.backgroundColor = [UIColor blackColor];
//[moviePlayer.view setFrame:CGRectMake(0, 0, 320, 410)];
[moviePlayer.view setFrame:[self.view bounds]];
moviePlayer.fullscreen = YES;
moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
[self.view addSubview:moviePlayer.view];
//[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
[moviePlayer play];
预先感谢..
你有没有找到任何解决方案? – Mangesh 2013-05-31 18:39:52