1.需要支持库
MediaPlayer.framework
2.代码
MPMoviePlayerController *mPlayer = [[MPMoviePlayerController alloc] init];
//视频地址 本地
NSString *path = [[NSBundle mainBundle] pathForResource:@"filename" andType:@"filetype"];
NSURL *url = [NSURL fileURLWithPath:path];
mPlayer.contentURL=url;
mPlayer.shouldAutoPlay=YES;
mPlayer.view.frame=CGRectMake(0,0,320,240);
//将mPlayer的view添加到self.view
[self.view addSubView:mPlayer.view];
over!