縦向きの場合はビューの上にある小さなウィンドウにビデオが表示されますが、横向きに切り替えると自動的に全画面表示に切り替わるシンプルなビデオ プレーヤーを作成しました。
youTubeアプリとよく似ています。
私の問題は、フルスクリーンモードにうまく移行できないことです。ナビゲーション/タブバー コントローラーは遷移しますが、私のビデオは基本的に一方から他方へと飛び出します。
ここに何が起こっているかの小さなビデオがあります:
http://screencast.com/t/jaOoPOHLh
ビデオを再生して向きを切り替えるために使用しているコードは次のとおりです。
self.controller = [[LBYouTubePlayerController alloc] initWithYouTubeURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=1fTIhC1WSew&list=FLEYfH4kbq85W_CiOTuSjf8w&feature=mh_lolz"] quality:LBYouTubeVideoQualityLarge];
self.controller.delegate = self;
self.controller.view.frame = CGRectMake(0.0f, 0.0f, 320.0f, 180.0f);
- (void) orientationChanged:(NSNotification *)note
{
//self.controller.view.hidden = YES;
UIDevice * device = note.object;
switch(device.orientation)
{
case UIDeviceOrientationPortrait:
/* start special animation */
self.controller.fullscreen = NO;
//self.controller.view.hidden = NO;
break;
case UIDeviceOrientationPortraitUpsideDown:
/* start special animation */
break;
case UIDeviceOrientationLandscapeLeft:
// do something
//self.controller.fullscreen = YES;
//self.controller.scalingMode = MPMovieScalingModeAspectFit;
//self.controller.view.hidden = NO;
break;
case UIDeviceOrientationLandscapeRight:
self.controller.fullscreen = YES;
self.controller.scalingMode = MPMovieScalingModeAspectFit;
self.controller.view.hidden = NO;
break;
default:
break;
};
}
ビデオトランジションを作成し、ナビゲーション/タブバーに一致させるために追加またはカスタムトランジションを行う必要があることはありますか?