Skip to main content

DrmEnvironmentRepository

Process-wide registry of named DrmEnvironment definitions.

A DRM environment bundles together the URLs and request/response modifiers needed to talk to a specific license server (e.g. DRMtoday, Verimatrix, or a custom proxy) for each supported DRM system. A PlayerConfiguration references an environment by name, which the player resolves through this repository at content load time.

Register environments once at application startup, typically in or after Sdk.initialize:

DrmEnvironmentRepository.register({
name: 'my-proxy',
widevine: {
getLicenseUrl: () => 'https://license.example.com/widevine',
licenseRequest: async (cfg, req) => { req.setHeaders({...}); return req; },
},
});

Methods​

register()​

static register(drmEnvironment): void

Registers a DRM environment so that any PlayerConfiguration referencing it by name can resolve and use it.

The environment is deep-cloned on insertion, so later mutations of the passed object will not affect the registered copy. Registering an environment with a name that is already in use replaces the previous registration.

Parameters​

ParameterTypeDescription
drmEnvironmentDrmEnvironmentThe environment to register. Its name field is used as the registry key.

Returns​

void