【发布时间】:2014-11-29 01:25:45
【问题描述】:
我是 iPhone 开发的新手,正在编写我的第一个应用程序。整个App只需要人像模式,除了播放电影。我正在使用 MPMoviePlayerController 启动电影,它以纵向模式播放。如何强制 MPMoviePlayerController 以横向播放所有电影。 我正在使用 Xcode 4 并为 iOS 4.0+ 构建。我是否需要在 info.plist 中输入一些设置以允许 MPMoviePlayerController 横向播放?
这是我用来初始化 MPMoviePlayerController 的代码:
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL: url];
[self.view addSubview:theMovie.view];
theMovie.allowsAirPlay=YES;
[theMovie setFullscreen:YES animated:YES];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
[theMovie play];
【问题讨论】:
标签: iphone cocoa-touch ios