AVPlayerViewController没有加载远程URL
我正在尝试在AVPlayerViewController
播放远程MP4video:
self.vcVideo = [[AVPlayerViewController alloc] init]; self.vcVideo.player = [AVPlayer playerWithURL:[NSURL URLWithString:videoURL]]; [self presentViewController:self.vcVideo animated:YES completion:^{ [self.vcVideo.player play]; }];
显示视图控制器但禁用播放按钮:
这是在iOS 9上。
在iOS9中,安全策略已更改。 在您的日志中,您应该看到有关安全性的信息。 我相信您的远程videourl是http而不是https。 您应该将这些行添加到plist文件中。
NSAppTransportSecurity NSAllowsArbitraryLoads