1.AVPlayer播放器支持WMV,AVI,MKV,RMVB,RM,XVID,MP4,3GP,MPG......格式
2.AVPlayer视频播放
框架 #import <AVFoundation/AVFoundation.h>
1)添加文件路径 NSString *path = [[NSBundle mainBundle]pathForResource:@"" ofType:nil]
2)把文件转换类型URL NSURL *url = [NSURL fileURLWithPath:path]
3)实例化player AVPlayer *player = [AVPlayer playerWithURL:url]
4)实例化playerLayer AVPlayerLayer *playerLayer = [AVPlayerLayerplayerLayerWithPlayer:player]
5)设置播放层的大小 playerLayer.frame = CGRectMake( , , , )
6) 加载 [self.view.layer addSublayer:playerLayer]
7)播放 [player play]
3.媒体播放器AVPlayer 、AVPlayerViewControllor
框架 #import <AVFoundation/AVFoundation.h>
#import <AVKit/AVKit.h>
1)定义一个 AVPlayerViewControllor
2)实例化 AVPlayerViewControllor
3)绑定播放器 [self presentViewController:_avViewController animated:YES completion:nil]
4)播放