Search code examples
azuredrmwidevine

How to generate license key of widevine from azure


I have searcherd on azure media-service, but don't get any option to generate license key for widevine. I have checked also docs, but I can't understand where to generate. I don't find the option "content protection" anywhere.

screenshot from docs


Solution

  • By using Azure Media Services (AMS) for streaming, you do not need to generate the license by yourself, you need to configure it and it will generate it for you.

    In general you need to do the following:

    1. Create a Content Key Policy, where you put the encryption key, audience and issuer, any other claims, license capability, ...
    2. Create a streaming locator with proper Streaming Policy. If you wish to use Widevine, you can choose Predefined_MultiDrmCencStreaming which give you the ability to support Widevine and PlayReady.
    3. When someone which to playback the video by using the streaming locator you generated in step #2, you need to generate a JWT token so AMS can verify him and deliver the license.

    You can find more information in the official documentation here Dynamic Encryption, Content Key Policy, and Streaming Policies. From here you can find .Net examples .Net examples

    I should mention here that AMS has 2 API versions v2 and v3, v2 deprecation has been announced to be 29 February 2024, so it's better to use the newer v3 version.