Documentation

Working With Axinom DRM

Scope of support

Axinom DRM is a robust multi-DRM service that provides a single, easy-to-use unified API, which works with Microsoft PlayReady, Apple FairPlay, and Google Widevine DRMs, and is compatible with all platforms and devices. Axinom DRM is Hollywood studio approved and supports the latest security requirements for premium UHD 4K, live content, and VOD to prevent piracy. Secure your revenue with a multi-DRM available for both online and offline environments with Axinom DRM.

This documentation will guide you on how to easily implement Axinom DRM with Radiant Media Player.

MPEG-DASH with Widevine and PlayReady DRM

First, you will need an account with Axinom DRM and to prepare your content for MPEG-DASH streaming with Widevine and PlayReady DRM. Radiant Media Player will take care of loading and parsing the MPEG-DASH manifest, contacting the DRM licensing servers and displaying content when authorised. Our MPEG-DASH streaming & DRM implementation is based on Shaka player. General documentation for MPEG-DASH streaming with Radiant Media Player can be found here. General documentation for using DRM with Radiant Media Player can be found here.

Below you will find a complete example for using Axinom DRM with Radiant Media Player.

<script src="https://cdn.radiantmediatechs.com/rmp/9.15.6/js/rmp.min.js"></script>
<div id="rmp"></div>
<script>
  // MPEG-DASH streaming URL
  const src = {
    dash: 'https://your-dash-url.mpd'
  };
  // Axinom DRM license server for PlayReady
  const playReadyLaURL = 'https://axinom-license-server-url-playready';
  // Axinom DRM license server for Widevine
  const widevineLaURL = 'https://axinom-license-server-url-widevine';
  // Axinom DRM custom headers
  const customHeaders = 'YYYYYYYYYYYYYYYYYYYYYYYYYYY';
  // create Radiant Media Player instance
  const rmp = new RadiantMP('rmp');
  const settings = {
    licenseKey: 'your-license-key',
    src: src,
    width: 640,
    height: 360,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    // here we pass our Axinom DRM data
    shakaDrm: {
      servers: {
        "com.widevine.alpha": widevineLaURL,
        "com.microsoft.playready": playReadyLaURL
      }
    }, 
    shakaRequestConfiguration: {
      license: {
        headers: {
          'X-AxDRM-Message': customHeaders,
        }
      }
    }
  };
  rmp.init(settings);
</script>

Apple FairPlay streaming (FPS)

We also support FairPlay streaming with Axinom DRM to Radiant Media Player. FairPlay streaming, which requires HLS, aims at providing support for DRM encrypted content to Apple devices. For Radiant Media Player, this is macOS Safari 11+, Safari for iOS 10+ and iPadOS 13+ and iOS 13+ and iPadOS 13+ WebView. More information about FPS support in Radiant Media Player can be found here.

<script src="https://cdn.radiantmediatechs.com/rmp/9.15.6/js/rmp.min.js"></script>
<div id="rmp"></div>
<script>
  const src = {
    fps: 'https://fps-hls-url.m3u8'
  };
  // Axinom DRM FPS configuration
  const arrayToString = function (array) {
    const uint16array = new Uint16Array(array.buffer);
    return String.fromCharCode.apply(null, uint16array);
  };
  const extractContentId = function (initData) {
    // "skd://{ContentID}" -> "{ContentID}"
    return arrayToString(initData).replace(/^.*:\/\//, '');
  };
  // licenseRequestMessage
  const licenseRequestMessage = function (message) {
    return message;
  };
  // licenseRequestLoaded
  const licenseRequestLoaded = function (event) {
    const request = event.target;
    const session = request.session;
    const arrayBuffer = request.response;
    const key = new Uint8Array(arrayBuffer);
    session.update(key);
  };
  // processSpcPath
  const processSpcPath = 'https://drm-fairplay-licensing.axinom-servers-uri.com/AcquireLicense';
  // licenseRequestHeaders
  const licenseRequestHeaders = [
    {
      name: 'Content-type',
      value: 'application/octet-stream'
    },
    {
      name: 'X-AxDRM-Message',
      value: 'ZZZZZZZZZZZZZZZZZ'
    },
  ];
  const settings = {
    licenseKey: 'your-license-key',
    src: src,
    width: 640,
    height: 360,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    // we pass here our FPS settings
    fpsDrm: {
      certificatePath: 'https://axinom-servers-uri.com/fairplay.cer',
      processSpcPath: processSpcPath,
      licenseResponseType: 'arraybuffer',
      licenseRequestHeaders: licenseRequestHeaders,
      extractContentId: extractContentId,
      licenseRequestMessage: licenseRequestMessage,
      licenseRequestLoaded: licenseRequestLoaded
    }
  };
  const rmp = new RadiantMP('rmp');
  rmp.init(settings);
</script>

Maximizing device reach with FPS + MPEG-DASH DRM

In real life case scenario, it is likely you will want to use a combination of MPEG-DASH with Widevine and PlayReady DRM and FPS DRM to maximise device reach. When you provide both MPEG-DASH DRM and FPS DRM data to Radiant Media Player it will automatically detect which is supported for the targeted device and use the related DRM information to playback content securely.

<script src="https://cdn.radiantmediatechs.com/rmp/9.15.6/js/rmp.min.js"></script>
<div id="rmp"></div>
<script>
  // MPEG-DASH streaming URL
  const src = {
    dash: 'https://your-dash-url.mpd',
    fps: 'https://fps-hls-url.m3u8'
  };
  // Axinom DRM license server for PlayReady
  const playReadyLaURL = 'https://axinom-license-server-url-playready';
  // Axinom DRM license server for Widevine
  const widevineLaURL = 'https://axinom-license-server-url-widevine';
  // Axinom DRM custom headers
  const customHeaders = 'YYYYYYYYYYYYYYYYYYYYYYYYYYY';
  // Axinom DRM FPS configuration
  const arrayToString = function (array) {
    const uint16array = new Uint16Array(array.buffer);
    return String.fromCharCode.apply(null, uint16array);
  };
  const extractContentId = function (initData) {
    // "skd://{ContentID}" -> "{ContentID}"
    return arrayToString(initData).replace(/^.*:\/\//, '');
  };
  // licenseRequestMessage
  const licenseRequestMessage = function (message) {
    return message;
  };
  // licenseRequestLoaded
  const licenseRequestLoaded = function (event) {
    const request = event.target;
    const session = request.session;
    const arrayBuffer = request.response;
    const key = new Uint8Array(arrayBuffer);
    session.update(key);
  };
  // processSpcPath
  const processSpcPath = 'https://drm-fairplay-licensing.axinom-servers-uri.com/AcquireLicense';
  // licenseRequestHeaders
  const licenseRequestHeaders = [
    {
      name: 'Content-type',
      value: 'application/octet-stream'
    },
    {
      name: 'X-AxDRM-Message',
      value: 'ZZZZZZZZZZZZZZZZZ'
    },
  ];
  const settings = {
    licenseKey: 'your-license-key',
    src: src,
    width: 640,
    height: 360,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    // here we pass our Axinom DRM data
    shakaDrm: {
      servers: {
        "com.widevine.alpha": widevineLaURL,
        "com.microsoft.playready": playReadyLaURL
      }
    }, 
    shakaRequestConfiguration: {
      license: {
        headers: {
          'X-AxDRM-Message': customHeaders,
        },
      },
    },
    // we pass here our FPS settings
    fpsDrm: {
      certificatePath: 'https://axinom-servers-uri.com/fairplay.cer',
      processSpcPath: processSpcPath,
      licenseResponseType: 'arraybuffer',
      licenseRequestHeaders: licenseRequestHeaders,
      extractContentId: extractContentId,
      licenseRequestMessage: licenseRequestMessage,
      licenseRequestLoaded: licenseRequestLoaded
    }
  };
  const rmp = new RadiantMP('rmp');
  rmp.init(settings);
</script>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

©2015-2024 Radiant Media Player. All Rights Reserved.