Я пытаюсь установить User Agent
для AvPlayer
в Delphi на основе короткого кода ниже:
NSMutableDictionary* * *headers = [NSMutableDictionary dictionary];
[headers setObject:@"YourHeader"forKey:@"User-Agent"];
self.urlAsset = [AVURLAsset URLAssetWithURL:self.videoURL options:@{@"AVURLAssetHTTPHeaderFieldsKey" : headers}];
self.playerItem = [AVPlayerItem playerItemWithAsset:self.urlAsset];
self.player = [AVPlayer playerWithPlayerItem:self.playerItem];
У меня проблемы с этой частью:
options:@{@"AVURLAssetHTTPHeaderFieldsKey" : headers}
Я объявил заголовки как NSMutableDictionary
и setobject
с необходимыми полями, но как мне назначить это ключу AVURLAssetHTTPHeaderFieldsKey
?
Я использую ALVideoPlayer
из библиотеки Alcinoe
и янужно установить там пользовательский агент.