代码拉取完成,页面将自动刷新
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor whiteColor];
NSString *path = [[NSBundle mainBundle]pathForResource:@"1" ofType:@"mp4"];
_player = [[XSMediaPlayer alloc]initWithFrame:CGRectMake(0, 100, 300, 300)];
_player.videoURL = [NSURL URLWithString:@"http://project.lanou3g.com/teacher/UIAPI/LOMV/432157/957c1e88bba6b811b9d8739e363c3a00.mp4"];
[self.view addSubview:_player];
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
self.view.backgroundColor = [UIColor whiteColor];
}else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
self.view.backgroundColor = [UIColor blackColor];
}
}
// 哪些页面支持自动转屏
- (BOOL)shouldAutorotate{
return YES;
}
// viewcontroller支持哪些转屏方向
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
// MoviePlayerViewController这个页面支持转屏方向
return UIInterfaceOrientationMaskAllButUpsideDown;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。