DRMtoday Onboard **************** Code samples: * DRMtoday Onboard (https://raw.githubusercontent.com/castlabs/prestoplay-web-code-samples/refs/heads/main/examples/drm/onboard.js): 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" | | | | (https://players.castlabs.com/web/latest/docs/api/clpp.drm.WidevineRobustnessLevel.md). | +-----------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------+ | "widevineAudioRobustness" | No | Widevine audio robustness levels. | | | | Default: "[SW_SECURE_CRYPTO, | | | | undefined]". See | | | | "drm.WidevineRobustnessLevel" | | | | (https://players.castlabs.com/web/latest/docs/api/clpp.drm.WidevineRobustnessLevel.md). | +-----------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------+ | "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" | | | | (https://players.castlabs.com/web/latest/docs/api/clpp.drm.PlayreadyRobustnessLevel.md). | +-----------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------+ | "playReadyAudioRobustness" | No | PlayReady audio robustness | | | | levels. Default: "undefined". See | | | | "drm.PlayreadyRobustnessLevel" | | | | (https://players.castlabs.com/web/latest/docs/api/clpp.drm.PlayreadyRobustnessLevel.md). | +-----------------------------------------+-----------------------------------+-----------------------------------------------------------------------------------------------+ | "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" | | | | (https://players.castlabs.com/web/latest/docs/api/clpp.drm.DrmToday.WidevineCertificates.md), | | | | 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 } } });