Custom DRM environment

Code samples

  • Custom DRM environment: registers a DRM environment with license request, license response, certificate request, and content ID modifiers.

Create a custom DRM environment when you need full control over the license acquisition process.

Create a drm.DrmEnvironment instance, configure it for the DRM systems you need, and register it globally with drm.registerDrmEnvironment. For the possible DRM system configurations, see drm.DrmEnvironment#setDrmSystem.

A custom DRM environment can look like this:

const environment = new clpp.drm.DrmEnvironment('myDrm');
environment.setDrmSystem(clpp.drm.KeySystem.WIDEVINE, {
  licenseUrl: '...',
});
environment.setDrmSystem(clpp.drm.KeySystem.FAIRPLAY, {...});
environment.setDrmSystem(clpp.drm.KeySystem.PLAYREADY, {...});

clpp.drm.registerDrmEnvironment(environment);

To use a custom DRM environment, pass its name in the Player.open call:

const player = new clpp.Player(...);
player.open({
  source: 'https://example.com/Manifest.mpd',
  drm: {
    env: 'myDrm', // the custom DRM environment name
    customData: {
      // optional data the custom DRM environment might need
    }
  }
});

To adapt license requests and responses to your license server, such as adding a token fetched at request time, add modifiers to the DRM systems of your environment. See Customizing license requests.

Previous topic: Verimatrix VCAS Ultra