Configure PlayReady Encryption for live streaming using Azure Media Services

A month after we announced live streaming with AES encryption, we are also adding PlayReady encryption capability onto your live stream. This blog is a walkthrough to show you how to configure this feature through APIs. Full source code is uploaded in this Github Repository. Please note this configuration will be added into portal in our next release.

First of all, before you get started, there is extra step for you to enable PlayReady license service on your account, please refer to my video for details: https://www.youtube.com/watch?v=nQCM1jFdi_4.

In my earlier post on how to configure Live Streaming using .NET SDK, there is step 8 used to create Program. When you create an asset with the Program, if you want your asset to be PlayReady encrypted, you need to define Content Key associated with the asset, the authorization policy on content key and asset delivery policy to be dynamic encryption. Please refer to the code block below for details:

There are several important points when you configure PlayReady Encryption:

  • 1. PlayReady uses Common Encryption, but AES uses Envelope encryption. Therefore, the methods for creating content key are different. Here is the method for creating PlayReady content key:

  • 2. I supplied methods for configuring both Token and Open authentication. PlayReady license template is defined when you defining Content Key Authorization policy. please refer to my code snippets below:

  • 3. This document shows you how to define PlayReady license template: http://msdn.microsoft.com/en-us/library/azure/dn783459.aspx. Below is one of the example:

  • In this sample PlayReady license template, I defined test device access, and unknown output for Android device playback.
  • You could use this Silverlight player to test your PlayReady encrypted live stream with or without token restriction: http://sltoken.azurewebsites.net/. For iOS and Android PlayReady SDK, please check out this page for accessing it: http://www.microsoft.com/PlayReady/features/ClientOptions.aspx.

If you have any questions, feel free to reach out to me at yanmf@microsoft.com. I’d love to explain further.

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.