Custom DRM environment ********************** Code samples: * Custom DRM environment (https://raw.githubusercontent.com/castlabs/prestoplay-web-code-samples/refs/heads/main/examples/drm/license_modifiers.js): 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" (https://players.castlabs.com/web/latest/docs/api/clpp.drm.DrmEnvironment.md) instance, configure it for the DRM systems you need, and register it globally with "drm.registerDrmEnvironment" (https://players.castlabs.com/web/latest/docs/api/clpp.drm.md#registerDrmEnvironment). For the possible DRM system configurations, see "drm.DrmEnvironment#setDrmSystem" (https://players.castlabs.com/web/latest/docs/api/clpp.drm.DrmEnvironment.md#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" (https://players.castlabs.com/web/latest/docs/api/clpp.Player.md#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.