首先需要导入你的视频文件。
比如 nizhan.mp4;
NSString *path = [[NSBundle mainBundle]pathForResource:@”nizhan” ofType:@”mp4”];
NSURL *url = [NSURL fileURLWithPath:path]; MPMoviePlayerController *player = [[MPMoviePlayerController alloc]initWithContentURL:url];
player.controlStyle = MPMovieControlStyleFullscreen;
[player.view setFrame:self.view.bounds];
[self.view addSubview:player.view];
[player play];
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交