美文网首页
AVPlayer播放视频链接修改请求头

AVPlayer播放视频链接修改请求头

作者: 小汐_challenge | 来源:发表于2018-08-20 11:38 被阅读0次

AVPlayer播放视频链接修改请求头

NSMutableDictionary* headers = [NSMutableDictionarydictionary];[headers setObject:@"YourHeader"forKey:@"User-Agent"];self.urlAsset = [AVURLAssetURLAssetWithURL:self.videoURL options:@{@"AVURLAssetHTTPHeaderFieldsKey": headers}];// 初始化playerItemself.playerItem = [AVPlayerItemplayerItemWithAsset:self.urlAsset];self.player = [AVPlayerplayerWithPlayerItem:self.playerItem];

相关文章

网友评论

      本文标题:AVPlayer播放视频链接修改请求头

      本文链接:https://www.haomeiwen.com/subject/ikikiftx.html