Eugene D. Gubenkov Eugene D. Gubenkov - 1 year ago 112
C# Question

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). 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

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! It's available here: This sample named as follows:

AES (JWT token) – On Demand [Tears of Steel Teaser]

How can I do protected video streaming via Azure media Services/Player on iPhone? Is it supported scenario at all?

Here is the relevant code that sets up the delivery policy:

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

Answer Source

Just found this exact scenario in the list of Azure Media Player "known issues":

AES and restricted token content does not playback using iOS and older Android devices. 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: I did not personally test it yet.


UPDATE. The workaround works after minor changes -- there was an issue with URL encoding for second-level HLS playlist. Here is full WebAPI 2 controller code that makes the trick for me:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download