DRMtoday

Code samples

The SDK includes a preconfigured DRMtoday environment. To use it, pass DRM configuration under the drm key in the Player.open call. Set the environment name to DRMtoday. A DRMtoday_STAGING environment is also available for testing.

player.open({
  source: 'https://example.com/Manifest.mpd',
  drm: {
    env: 'DRMtoday',
    customData: {
      userId: 'purchase',
      sessionId: 'p0',
      merchant: 'six',
    }
  }
});

Specific properties of the DRMtoday environment, set under drm.customData:

Property

Required

Description

userId

Yes

The userId parameter sent to DRMtoday.

sessionId

Yes

The sessionId parameter sent to DRMtoday.

merchant

Yes

The merchant parameter.

authToken

No

The DRMtoday authentication token used for the license request when upfront authentication is used.

assetId

No

The asset ID of the content the license is requested for. Not required in all setups, but useful in some.

variantId

No

The variant ID of the content the license is requested for. Not required in all setups, but useful in some.

widevineVideoRobustness

No

Widevine video robustness levels. Default: [HW_SECURE_ALL, HW_SECURE_DECODE, HW_SECURE_CRYPTO, SW_SECURE_DECODE, SW_SECURE_CRYPTO]. See drm.WidevineRobustnessLevel.

widevineAudioRobustness

No

Widevine audio robustness levels. Default: [SW_SECURE_DECODE, SW_SECURE_CRYPTO]. See drm.WidevineRobustnessLevel.

widevineDistinctiveIdentifierRequired

No

Whether a persistent distinctive identifier is required. Default: false.

widevinePersistentStateRequired

No

Whether the ability to persist state is required. Default: false.

playReadyVideoRobustness

No

PlayReady video robustness levels. Default: [3000, 2000, 150]. See drm.PlayreadyRobustnessLevel.

playReadyAudioRobustness

No

PlayReady audio robustness levels. Default: [2000, 150]. See drm.PlayreadyRobustnessLevel.

serverCertificate

No

The Widevine server certificate. DRMtoday selects the right certificate by default; use this to select one explicitly. See drm.DrmToday.WidevineCertificates.

Next topic: DRMtoday Onboard
Previous topic: DRM