Skip to main content

Making of a DRM player

A video player should be capable of handling DRM key exchanges for it to be able to play encryption videos. This is how a typical workflow looks like.

Player flow diagram

When playing a DRM encrypted video, a video player will ask for three things

  1. URL to the manifest file of the video
  2. Name of the DRM system to use
  3. URL of the License

Out of the above, the manifest URL and DRM system does not change for each session. DRM system is to be evaluated based on the browser and DRM availability. Chrome, Firefox and Edge support Widevine while Safari supports Fairplay.

The license URL should change for each playback session. It contains a very short-term authorisation to play the video. Each time the player loads, it should fetch this URL from the backend. The URL consists of two parts, a policy and a signature. The policy defines the restrictions applied to the URL. The signature is generated on the application server. The application server should be configured to generate this URL only after the logged-in user has been authenticated, and the access to the content has been verified. Instructions for generating License URL

Recommendations​

Shaka player​

Shaka player is a video player maintained by google which supports multiple DRM systems including Widevine and Fairplay. The player provides a number of configuration options along with a native looking UI.

DashIF Player​

This is another player maintained by a consortium of different companies (called DASH Industry Forum). It also has many API options and UI to get you started in no time.

About the key exchange​

During DRM playback, there is a key-exchange that happens between the CDM and the license server. Check the exchange between the player, browser and VdoCipher in the diagram above.

The key exchange for Widevine is pretty straight-forward and even without any options, there is a simple exchange of binary blobs that take place by default. If you use one of the sample page, this is API which will be used. In the case of Fairplay, the key-exchange itself is not standardised as in Widevine. There is an API which will give the license-request and another which consumes the license-response. The exchange of this information is brokered by the javascript application. To make this easier, we also provide a javascript code to make the playback simple.

Doing it yourself​

It is possible to skip on other video players and make it yourself. You can use the EME extensions to make it work. However, we recommend using one of the existing open-source players to begin with.