CONNECT Player SDK 5 for Browsers and Connected TV

DRM preferences and security levels

The CONNECT Player SDK for Browsers supports different DRM key systems depending on the browser/device, and the content protocol:

  • Widevine

  • Playready

  • FairPlay

The key systems may have different security levels, depending on the capabilities of the device and browser on which they are used.

Four increasing security levels are defined:

  1. OTVDRMSL_UNKNOWN

  2. OTVDRMSL_SW

  3. OTVDRMSL_HW_CRYPT

  4. OTVDRMSL_HW_DECODE

Where multiple DRM key systems are supported by a browser, the SDK provides mechanisms by which the application can specify its preferred key system. The SDK provides an API to find the security level of the key system on the browser to aid selection of the preferred key system.

Querying security level capabilities

To query security level capabilities use the getDrmInfo() API call which returns a Promise that resolves to provide an array of the DRM capabilities.

JavaScript
playerInstance
   .otvtoolkit()
   .drmSecurityLevel.getDrmInfo(keySystem, mediaType, contentType);

When details of a specific DRM key system and optionally a specific media and content type combination are required, this can be requested in the arguments to getDrmInfo(). For example, querying for Widevine encrypted video at a specific codec, if the mediaType and contentType parameter combination is omitted, then defaults will be used depending on the keySystem:

JavaScript
playerInstance
   .otvtoolkit()
   .drmSecurityLevel.getDrmInfo(
       "com.widevine.alpha",
       "video",
       'video/mp4;codecs="avc1.640015"'
   );

keySystem

mediaType

contentType

com.microsoft.playready

video

video/mp4;codecs=“avc1”

com.widevine.alpha

video

video/mp4;codecs=“avc1.640015”

com.apple.fairplay

none

none

When details of a specific DRM key system and optionally a specific media and content type combination, this can be requested in the arguments to getDrmInfo(). For example, querying for Widevine encrypted video generically:

JavaScript
playerInstance
   .otvtoolkit()
   .drmSecurityLevel.getDrmInfo("com.widevine.alpha");

When no arguments are supplied, all DRM systems are queried and the results will contain their capabilities (only supported key systems are included in the results). Querying all supported keySystems:

JavaScript
playerInstance.otvtoolkit().drmSecurityLevel.getDrmInfo();

Setting the preferred DRM key system

If no preferred DRM key system is specified, the supported key system with the highest security level will be preferred.

JavaScript
otvplayer(
 "videoPlayer",
 // options
 {
        ......
     plugins: {
         otvtoolkit: {
             drm: {
                    ......
                 config: {
                     preferredDRM: "com.widevine.alpha"
                 }
             }
         }
     }
 }
);
JavaScript
player.src({
    src: stream.url,
    token: stream.Token,
    preferredDRM: "com.widevine.alpha"
});
JavaScript
playerInstance
   .otvtoolkit()
   .drmSecurityLevel.setPreferredDrm("com.widevine.alpha");

Finding the actual key system used for playback

The application may select a preferred key system which is not supported by the browser, or not supported for a piece of content. In this case, the SDK will use a different key system. To find the actual key system in use during playback:

JavaScript
let ks = playerInstance.otvtoolkit().drmSecurityLevel.getCurrentSelectedDrm();

getCurrentSelectedDrm() is only valid during playback. Until playback starts, it will return the preferred DRM key system.