这次做了视频的播放器,坑啊 ,好多,这不,刚刚爬上来,就来帮后来者填坑。。。
3. 好了,在appdelegate中就写上这个了,是不是很简单呢
首先先说下横竖屏切换旋转的坑吧,,,
1. 在AppDelegate.h文件中 声明一个变量,
@property (nonatomic, assign) NSInteger rotateDirection;
2. 在AppDelegate.m文件中 加一个判断旋转函数
//此方法会在设备横竖屏变化的时候调用
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (self.rotateDirection == 1)
{
return UIInterfaceOrientationMaskLandscapeRight; // 支持右屏旋转
}
return UIInterfaceOrientationMaskPortrait;
}
接下来就是在你要旋转的那个文件里面,比如:LiveVC
就在LiveVC.m中写上手动旋转屏幕的函数:
- (void)fullScreenWithPlayerView:(XYVideoPlayerView *)videoPlayerView
{