 
 
|  |      1kevinroot      2017-03-20 16:43:31 +08:00 我记得设计屏幕方向就好 // 全屏按钮点击 if ([UIDevice currentDevice].orientation != UIDeviceOrientationPortrait) { NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait]; [[UIDevice currentDevice] setValue:value forKey:@"orientation"]; } else { NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]; [[UIDevice currentDevice] setValue:value forKey:@"orientation"]; } // 可能用的是事件通知 [[NSNotificationCenter defaultCenter] postNotificationName:MPMoviePlayerWillEnterFullscreenNotification object:nil]; | 
|  |      2pheyer      2017-03-20 16:45:26 +08:00 via iPhone 一个不是办法的办法:可以逆向一下新浪微博 app 看看。 | 
|  |      3run2      2017-03-20 16:49:53 +08:00 截屏》隐藏 player 》动画》显示 player ? | 
|  |      4kera0a OP | 
|  |      5run2      2017-03-20 17:54:42 +08:00 @kera0a #4 直播? 录像视频播放的话暂停也好啊,不会遗漏(可能的)重要画面。 https://github.com/BrikerMan/BMPlayer https://github.com/easyui/EZPlayer 看他们的截图,转屏好像是有过渡的 | 
|  |      6kera0a OP | 
|      7HelveticaNeue      2017-03-20 20:37:12 +08:00 via iPhone 能否给个 demo ,我可以帮着调一下 | 
|  |      8kera0a OP @wuyuehyang 谢谢大兄弟! ZFPlayer 存在这个问题,并且他的全屏逻辑非常简单适合调试。如果你有兴趣的话可以调试下这个库。 | 
|      9HelveticaNeue      2017-03-21 18:57:06 +08:00 @kera0a  我看了一眼 ZFPlayer 的代码,质量实在太差,眼疼不想看。 我写了一个 demo ,转屏时没有发现你说的问题,你看一下是不是这个效果 https://github.com/WuYuehYang/TestAVPlayerRotation | 
|  |      10kera0a OP @wuyuehyang 非常感谢,你这个没有问题。 我自己测试后发现 AVPlayer 改变方向动画 跟随 ViewController 横竖屏动画时没问题。 我的实现是自己做 transform 动画改变角度(不做一些处理会有上面的问题,普通的 AVPlayer 做一些处理也能显示完美) 不过可惜的是 我用的不是单纯的 AVPlayer ,是 AsyncDisplayKit 的 ASVideoNode ,并且加了很多 flex 布局(这些布局倒是动画正常), 这个控件用你的方法还是会有问题 不过总算知道个大概路线了,我先自己慢慢试吧,看看 ASVideoNode 的源码先折腾下。 |