webview内的MPMoviePlayerController

2016-06-29  本文已影响0人  简书笔记存档

应项目要求,播放器要实现全屏之后横屏,查找半天资料终于找到相应的资料
资料源:http://www.jianshu.com/p/deecfa886dac
实现方法:
在appdelegate页面:
.h
@property(nonatomic)BOOL allowRotation;
.m

pragma mark ------------ MediaPlayer选择全屏模式

实现以下方法

-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (self.allowRotation) {
项目要求直接横屏,所以我只选择一个方向。
return UIInterfaceOrientationMaskLandscapeRight;
}
return UIInterfaceOrientationMaskPortrait;
}

现在就可以实现全屏啦

上一篇 下一篇

猜你喜欢

热点阅读