iOSアプリでビデオを再生するためにMoviePlayerコントローラーを使用しています。私はこのようなオリエンテーション通知を使用しています
if(deviceOrientation ==UIDeviceOrientationLandscapeLeft)
{
NSLog(@"Replay is in Landscape");
self.fullScreenFlag = YES;
[self.moviePlayer setFullscreen:YES animated:NO];
}
これにより、ユーザーが電話を横向きにしたときに、ビデオ画面が全画面で再生されます。しかし、moviePlayerコントロールの完了ボタンを押すと、次の方法に入ります
- (void)movieWillExitFullscreen:(NSNotification*)notification
{
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
if(deviceOrientation ==UIDeviceOrientationLandscapeLeft) {
NSLog(@"Pressed Done in Landscape");
//Problem: Here I want to force my VideoViewController to rotate back to portrait Mode
}
}
ユーザーが完了ボタンを押すか、ビデオの再生が停止するとすぐに、VCをポートレートに戻す方法がわかりません。私はmoviePlayerNotificationMethodsを知っていますが、オリエンテーションのためにこれらのメソッドで何を呼び出すべきかが明確ではありません。