Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Dynamically encrypt your content with Widevine DRM

This sample demonstrates how to dynamically encrypt your content with Widevine DRM. It shows how to perform the following tasks:

  1. Creates a transform with built-in AdaptiveStreaming preset
  2. Submits a job
  3. Creates a ContentKeyPolicy with Widevine configuration using a secret key
  4. Associates the ContentKeyPolicy with StreamingLocator
  5. Gets a token and print a url for playback

When a user requests Widevine-protected content, the player application requests a license from the Media Services license service. If the player application is authorized, the Media Services license service issues a license to the player. A Widevine license contains the decryption key that can be used by the client player to decrypt and stream the content.

Prerequisites

Required Assemblies:

  • Azure.Identity
  • Azure.ResourceManager.Media
  • Microsoft.Extensions.Hosting
  • Microsoft.IdentityModel.Tokens
  • Newtonsoft.Json
  • System.IdentityModel.Tokens.Jwt
  • System.Security.Claims

An Azure Media Services account. See the steps described in Create a Media Services account.

Build and run

Update the settings in appsettings.json in the root folder to match your Azure subscription, resource group and Media Services account. Then build and run the sample in Visual Studio or VS Code.

The sample will authenticate using any of the methods supported by DefaultAzureCredential.

Key concepts

Next steps