Web 播放器 SDK

DRM

(以下內容均翻譯自英文版文件,最新資訊及內容敬請切換至英文語系參考原文)

 

要整合 BlendVision One DRM,請在來源選項中添加相關選項,如下所示。

可在 此處 找到 drmUrl ,以及 playbackToken啟動播放工作階段的相同令牌 。

const drmHeaders: {
  'x-custom-data': `token_type=upfront&token_value=${playbackToken}`,
} // Caution: not resource token, it is valid for 24 hours

const player = createPlayer('player-container', {
  license, // license is not required when testing in local development environment
  source: [
    {
      type: 'application/dash+xml',
      src: dashUrl,
      drm: {
        widevine: {
          licenseUri: drmUrl,
          headers: drmHeaders,
        },
        playreacy: {
          licenseUri: drmUrl,
          headers: drmHeaders,
        },
      },
    },
    {
      type: 'application/x-mpegurl',
      src: hlsUrl,
      drm: {
        fairplay: {
          licenseUri: drmUrl,
          certificateUri: `${drmLicensePortalUrl}/fairplay_cert`,
          headers: drmHeaders,
        },
      }
    }
  ],
})

更新於