DRMtoday Onboard

Code samples

  • DRMtoday Onboard: a DRM-protected DASH stream with licenses from a DRMtoday Onboard server.

Onboard is the offline architecture for DRMtoday. It lets you install a DRMtoday server on a private network — for example, on board a bus, plane, train, or ship.

Enable Onboard by defining an environment name and the URL of your local DRMtoday Onboard server. The SDK registers a new environment automatically using the specified name and URL. We suggest the name DRMtodayOnboard to avoid a collision with other predefined environments. You can also pass other custom data, such as a user ID or session ID.

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

Property

Required

Description

baseUrl

Yes

The base URL of the DRMtoday Onboard server.

widevineUrl

No

Appended to the base URL to form the Widevine URL. Default: widevine.

playreadyUrl

No

Appended to the base URL to form the PlayReady URL. Default: playready.

fairplayUrl

No

Appended to the base URL to form the FairPlay URL. Default: fairplay.

widevineVideoRobustness

No

Widevine video robustness levels. Default: [SW_SECURE_DECODE, undefined]. See drm.WidevineRobustnessLevel.

widevineAudioRobustness

No

Widevine audio robustness levels. Default: [SW_SECURE_CRYPTO, undefined]. 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: undefined. See drm.PlayreadyRobustnessLevel.

playReadyAudioRobustness

No

PlayReady audio robustness levels. Default: undefined. See drm.PlayreadyRobustnessLevel.

serverCertificate

No

The Widevine server certificate. If unset, the SDK uses its default certificate. Set to null to fetch the certificate from the Widevine server, a string to use drm.DrmToday.WidevineCertificates, or a Uint8Array to use it directly as the certificate.

Import the DRMtoday Onboard component:

import "@castlabs/prestoplay/cl.onboard";

Minimal example:

const player = new clpp.Player(...);

player.open({
  source: 'https://example.com/Manifest.mpd',
  drm: {
    env: 'DRMtodayOnboard',
    customData: {
      baseUrl: 'offlineDRMTodayServerUrl',
    }
  }
});

More complex example:

const player = new clpp.Player(...);

player.open({
  source: 'https://example.com/Manifest.mpd',
  drm: {
    env: 'DRMtodayOnboard',
    customData: {
      baseUrl: 'offlineDRMTodayServerUrl',
      widevineUrl: 'widevine',
      playreadyUrl: 'playready',
      fairplayUrl: 'fairplay',
      serverCertificate: null, // Forces fetching the certificate from the Widevine server
    }
  }
});
Next topic: Header-based DRM
Previous topic: DRMtoday