AVPlayer添加请求头
2018-07-06 本文已影响100人
白雪天枫
NSMutableDictionary * headers = [NSMutableDictionary dictionary];
RequestType = @"http://"
BaseUrl =@"video.haohaohao.com" 这个是你的header
[headers setObject:[NSString stringWithFormat:@"%@%@",RequestType,BaseUrl] forKey:@"Referer"];
self.urlAsset = [AVURLAsset URLAssetWithURL:self.videoURL options:@{@"AVURLAssetHTTPHeaderFieldsKey" : headers}];