私のアプリでビデオをストリーミングしようとしています。私が見つけた方法は次の通りです:MPMoviePlayerViewController |ランドスケープモードを許可する
NSURL *theMovieURL = [NSURL URLWithString:self.data.trailer];
if (theMovieURL)
{
self.movieController = [[MPMoviePlayerViewController alloc] initWithContentURL:theMovieURL];
[self presentMoviePlayerViewControllerAnimated:self.movieController];
[self.movieController.moviePlayer play];
}
私はそれが最も一般的であるかどうかは分かりませんが、それはうまくいきます。
問題は、私は、風景モードを許可する方法をビデオでしか理解できないということです。 shouldAutorotate
またはshouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
のようなものを使用する必要がありますか?
FYI、アプリ全体はポートレートモードのみを許可します。
ありがとうございました。
presentViewControllerが却下されているかどうかをチェックします(isBeingDismissedプロパティ)。そうでない場合は、プレゼンテーションビューコントローラがlandscapemodeに表示されます – peko