我创建了一个简单的视频播放器,当它在视图顶部的小窗口中显示视频时,但当切换到横向时,它会自动切换到全屏。
很像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;
};
}
我是否需要添加内容或自定义转换,我认为要进行视频转换并匹配导航/标签栏?