简体   繁体   English

Azure Media Player无法在iPhone上使用AES保护

[英]Azure Media Player does not work with AES protection on iPhone

We are having issues playing a protected with AES (with JWT token authentication) video on iPhone 6 (A1586). 我们在iPhone 6(A1586)上使用AES(使用JWT令牌身份验证)视频播放受保护的问题。 The following error arrears: 以下错误拖欠:

0x50300000 - The video playback was aborted due a corruption problem or because the video used features your browser did not support 0x50300000 - 视频播放由于损坏问题而中止,或者因为浏览器不支持视频使用功能而中止

The very same video plays w/o any problems when encryption is disabled. 禁用加密时,同一视频不会出现任何问题。

The thing is that the sample that replicates such scenario published by Azure Media Player team does not work either and fails with the very same error! 问题是复制Azure Media Player团队发布的这种场景的样本 也不起作用,并且失败并出现同样的错误! It's available here: https://ampdemo.azureedge.net/ . 它可以在这里找到: https//ampdemo.azureedge.net/ This sample named as follows: 此示例命名如下:

AES (JWT token) – On Demand [Tears of Steel Teaser] AES(JWT令牌) - 随需应变[钢铁预告片]

How can I do protected video streaming via Azure media Services/Player on iPhone? 如何通过iPhone上的Azure媒体服务/播放器进行受保护的视频流? Is it supported scenario at all? 是否支持场景?

Here is the relevant code that sets up the delivery policy: 以下是设置交付政策的相关代码:

    deliveryPolicy = context.AssetDeliveryPolicies.Create(
        DeliveryPolicyName,
        AssetDeliveryPolicyType.DynamicEnvelopeEncryption,
        AssetDeliveryProtocol.SmoothStreaming | AssetDeliveryProtocol.Dash | AssetDeliveryProtocol.HLS,
        new Dictionary<AssetDeliveryPolicyConfigurationKey, string>
        {
            { AssetDeliveryPolicyConfigurationKey.EnvelopeKeyAcquisitionUrl, contentKey.GetKeyDeliveryUrl(ContentKeyDeliveryType.BaselineHttp).ToString() }
        }
    );

Just found this exact scenario in the list of Azure Media Player "known issues": https://amp.azure.net/libs/amp/latest/docs/Known_Issues.html . 刚刚在Azure Media Player“已知问题”列表中找到了这个确切的场景: https//amp.azure.net/libs/amp/latest/docs/Known_Issues.html

AES and restricted token content does not playback using iOS and older Android devices. AES和受限制的令牌内容无法使用iOS和较旧的Android设备播放。 In order to achieve this scenario, a proxy must be added to your service. 为了实现此方案,必须将代理添加到您的服务中。

This workaround that is proposed by Azure team is described in this article: https://azure.microsoft.com/en-us/blog/how-to-make-token-authorized-aes-encrypted-hls-stream-working-in-safari/ . Azure团队提出的此解决方法在本文中进行了描述: https//azure.microsoft.com/en-us/blog/how-to-make-token-authorized-aes-encrypted-hls-stream-working- in-safari / I did not personally test it yet. 我还没有亲自测试过它。

解决方法

UPDATE. UPDATE。 The workaround works after minor changes -- there was an issue with URL encoding for second-level HLS playlist. 解决方法在稍作更改后仍然有效 - 第二级HLS播放列表的URL编码存在问题。 Here is full WebAPI 2 controller code that makes the trick for me: http://pastebin.com/kq7Zfw88 . 这是完整的WebAPI 2控制器代码,为我提供了一些技巧: http ://pastebin.com/kq7Zfw88。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM