代码搬运工复制粘贴就能用
1.先导入AVFoundation.framework框架
1.引入头文件
#import <AVKit/AVKit.h>
#import <AVFoundation/AVFoundation.h>
//本地视频播放
// NSString * path = [[NSBundle mainBundle]pathForResource:@"IMG_0028" ofType:@"m4v"];
// NSURL *url = [NSURL fileURLWithPath:path];
//网络获取视频播放
NSString *asd = @"http://v.jxvdy.com/sendfile/w5bgP3A8JgiQQo5l0hvoNGE2H16WbN09X-ONHPq3P3C1BISgf7C-qVs6_c8oaw3zKScO78I--b0BGFBRxlpw13sf2e54QA";
NSURL *url1 = [NSURL URLWithString:asd];
AVPlayerViewController * play = [[AVPlayerViewController alloc]init];
play.player = [[AVPlayer alloc]initWithURL:url1];
[self presentViewController:play animated:YES completion:nil];