Skip to main content
Skip table of contents

DRM protected playback

To test this feature and view the example code, please see the Browsers and Connected TV SDK 5 Example Code Quick Start guide.

Configuring the otvtoolkit plugin for DRM

To enable DRM, add the appropriate parameters to the options object; these will vary for SSP and Conax integrations.

JS
var drmSystem = null;
if (
  window.navigator.userAgent.indexOf("Safari") !== -1 &&
  window.navigator.userAgent.indexOf("Chrome") === -1
) {
  if (fairPlayMode === undefined || fairPlayMode === "nagra-ssp-fps") {
    drmSystem = {
      system: "nagra-ssp-fps",
      config: {
        tenantId: myTenantId,
        licenceServer: fairplayLicenceServerUrl
      }
    };
  } else if (fairPlayMode === "nagra-conax-fps") {
    drmSystem = {
      system: "nagra-conax-fps",
      config: {
        portalURL: conaxPortalUrl,
        certificatesURL: conaxCertificateUrl,
        licenceServer: conaxLicenceServerUrl
      }
    };
  }
} else {
  drmSystem = {
    system: "nagra-ssp",
    config: {
      mode: "token",
      tenantId: myTenantId,
      licenceServer: sspLicenceServerUrl
    }
  };
}

Then initialise the otvtoolkit.

JS
let playerInstance = otvplayer(
    "videoPlayer",
    // options
    {
        plugins: {
            otvtoolkit: {
                drm: drmSystem
            }
        }
    },
    // loaded callback
    function loadedCallback() {
    ...
    }
);

The drm section of the otvtoolkit plugin contains the name of the DRM system (in this case, nagra-ssp, nagra-ssp-fps or nagra-conax) and a system-specific configuration object.

Because the otvtoolkit plugin is configured by the options object, you do not need to initialise the toolkit in loadedCallback().

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.