我正在开发iOS应用程序,我可以使用下面的代码播放.ism / manifest文件(请参阅注释的URL),但我的文件是AES加密的,需要使用承载令牌来解密它。你可以告诉我如何将持有人令牌传递给AVPlayer吗?
public override void ViewDidLoad()
{
base.ViewDidLoad();
//var url = new NSUrl("https://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=m//3u8-aapl)");
var url = new NSUrl("https://amssamples.streaming.mediaservices.windows.net/830584f8-f0c8-4e41-968b-6538b9380aa5/TearsOfSteelTeaser.ism/manifest(format=m3u8-aapl)");
audioPlayer = new AVPlayer();
var keys = new object[] { "Authorization" };
var objects = new object[] { "Bearer " + "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cm46bWljcm9zb2Z0OmF6dXJlOm1lZGlhc2VydmljZXM6Y29udGVudGtleWlkZW50aWZpZXIiOiI5ZGRhMGJjYy01NmZiLTQxNDMtOWQzMi0zYWI5Y2M2ZWE4MGIiLCJpc3MiOiJodHRwOi8vdGVzdGFjcy5jb20vIiwiYXVkIjoidXJuOnRlc3QiLCJleHAiOjE3MTA4MDczODl9.lJXm5hmkp5ArRIAHqVJGefW2bcTzd91iZphoKDwa6w8" };
var dictionnary = NSDictionary.FromObjectsAndKeys(objects, keys);
AVUrlAsset asset = new AVUrlAsset(url, dictionnary);
audioPlayer.ReplaceCurrentItemWithPlayerItem(new AVPlayerItem(asset));
audioPlayer.Play();
}