為布萊特灣玩家建立破折號 DRM 資訊清單

在本主題中,您將學習如何為Brightcove Player創建具有DRM保護的MPEG-DASH清單(.MPD文件)。

概覽

MPEG-DASH清單(.MPD文件)描述了具有使用通用加密(CENC)加密的MPEG-DASH格式的視頻,並且與Playready,Widevine和Marlin內容解密模塊(CDM)兼容。Brightcove的Web播放器僅支持Playready和Widevine,這取決於所使用的瀏覽器。

瀏覽器支持

播放僅在受支持的台式Macintosh和Windows瀏覽器上有效。

瀏覽器類型 播放技術 DRM類型
鉻34+ 原生 MS/EME 播放使用莎嘉播放器 * Widevine
Windows 10 上的微軟邊緣 原生 MS/EME 播放使用莎嘉播放器 * Playready
所有其他瀏覽器,包括Safari,IE和Firefox Silverlight插件 Playready

外部DRM內容

在Brightcove Video Cloud外部創建的DRM內容的要求

為了播放使用Brightcove Player應用了DRM保護的視頻內容,必須按照以下準則對視頻進行編碼。

  1. 必須是MPEG-DASH Live Profile(不是“按需”,不是“ hbbtv”)
  2. 所有重演必須具有相同的關鍵幀間隔和幀頻(以與我們的Silverlight插件兼容)
  3. 必須使用通用加密(CENC)進行加密並啟用Playready和Widevine支持
  4. 必須提供Playready和Widevine許可證服務器URL。Playready許可證服務器URL必須包含在清單文件(.mpd)中。Widevine許可證服務器URL可以在清單中提供,也可以作為Javascript中的參數提供
  5. 可播放的初始化向量必須為8個字節。

範例資訊清單

這是Video Cloud生成的示例MPEG-DASH清單(.MPD文件)。

<?xml version="1.0" ?>
<MPD mediaPresentationDuration="PT1M28S" minBufferTime="PT2.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:mspr="urn:microsoft:playready" xmlns:mas="urn:marlin:mas:1-0:services:schemas:mpd">
   <Period>
      <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1">
         <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="5d97af80-2442-4fe9-b1aafc24ecb6fa28" xmlns:cenc="urn:mpeg:cenc:2013"/>
         <ContentProtection schemeIdUri="urn:uuid:5E629AF5-38DA-4063-8977-97FFBD9902D4">
            <mas:MarlinContentIds>
               <mas:MarlinContentId>urn:marlin:kid:5d97af8024424fe9b1aafc24ecb6fa28</mas:MarlinContentId>
            </mas:MarlinContentIds>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95">
            <mspr:pro>jAIAAAEAAQCCAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4AZwBLACsAWABYAFUASQBrADYAVQArAHgAcQB2AHcAawA3AEwAYgA2AEsAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBVAGQAawBLAGIASQBBAHgAbgBOAGcAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAHIAbABpAGMALgBiAHIAaQBnAGgAdABjAG8AdgBlAC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC8AMwA3ADIAMwA0ADkANgAyADcANwAwADAAMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</mspr:pro>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" bc:licenseAcquisitionUrl="https://wvlic.brightcove.com/proxy/4324249227001" xmlns:bc="urn:brightcove:2015"/>
         <SegmentTemplate duration="2000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="0" timescale="1000"/>
         <Representation bandwidth="43241" id="4324360320001/audio/und" codecs="mp4a.40.5" audioSamplingRate="22050">
            <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
         </Representation>
      </AdaptationSet>
      <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" scanType="progressive">
         <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="5d97af80-2442-4fe9-b1aafc24ecb6fa28" xmlns:cenc="urn:mpeg:cenc:2013"/>
         <ContentProtection schemeIdUri="urn:uuid:5E629AF5-38DA-4063-8977-97FFBD9902D4">
            <mas:MarlinContentIds>
               <mas:MarlinContentId>urn:marlin:kid:5d97af8024424fe9b1aafc24ecb6fa28</mas:MarlinContentId>
            </mas:MarlinContentIds>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95">
            <mspr:pro>jAIAAAEAAQCCAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4AZwBLACsAWABYAFUASQBrADYAVQArAHgAcQB2AHcAawA3AEwAYgA2AEsAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBVAGQAawBLAGIASQBBAHgAbgBOAGcAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAHIAbABpAGMALgBiAHIAaQBnAGgAdABjAG8AdgBlAC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC8AMwA3ADIAMwA0ADkANgAyADcANwAwADAAMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</mspr:pro>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" bc:licenseAcquisitionUrl="https://wvlic.brightcove.com/proxy/4324249227001" xmlns:bc="urn:brightcove:2015"/>
         <SegmentTemplate duration="2000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="0" timescale="1000"/>
         <Representation bandwidth="237182" id="4324360320001/video/1" codecs="avc1.42c015" frameRate="30" width="400" height="300"/>
         <Representation bandwidth="601518" id="4324360321001/video/1" codecs="avc1.42c015" frameRate="30" width="400" height="300"/>
         <Representation bandwidth="981387" id="4324360323001/video/1" codecs="avc1.42c016" frameRate="30" width="480" height="360"/>
         <Representation bandwidth="1507704" id="4324360324001/video/1" codecs="avc1.42c01e" frameRate="30" width="640" height="480"/>
         <Representation bandwidth="2102387" id="4324360325001/video/1" codecs="avc1.42c01e" frameRate="30" width="640" height="480"/>
         <Representation bandwidth="2991373" id="4324360326001/video/1" codecs="avc1.42c01e" frameRate="30" width="640" height="480"/>
      </AdaptationSet>
   </Period>
</MPD>

許可證信息

為了創建與Brightcove Player兼容的自己的DASH-DRM流,您的編碼系統必須創建與上面提供的清單類似的清單(MPD),其中包括有關DRM許可證的信息。您的MPD可以忽略今天Brightcove Player尚未使用的Marlin部分。

指定PlayReady許可證密鑰

Brightcove Player要求PlayReady許可信息作為64位編碼的字符串嵌入MPD中。您可以在以下示例中看到該值<mspr:pro>標籤上方。編碼後的密鑰信息如下所示。有關PlayReady標頭格式的信息,可以在這裡找到: http://www.microsoft.com/playready/documents/

<WRMHEADER xmlns="http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version="4.0.0.0"><DATA><PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>gK+XXUIk6U+xqvwk7Lb6KA==</KID><CHECKSUM>UdkKbIAxnNg=</CHECKSUM><LA_URL>https://prlic.brightcove.com/license/3723496277001</LA_URL></DATA></WRMHEADER>

指定Widevine許可證URL

請注意,此行的MPD中提供了Widevine許可證服務器URL:

<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" bc:licenseAcquisitionUrl="https://wvlic.brightcove.com/proxy/4324249227001" xmlns:bc="urn:brightcove:2015"/>

另外,您可以在嵌入頁面的JavaScript中將Widevine許可證服務器URL作為參數提供給播放器。下面是一個示例,該示例如何調用Brightcove Player並指定帶有源URL的許可證服務器:

myPlayer.src({
  "src": sourceUrl,
  "type": "application/dash+xml",
  "keySystemOptions": [{
    "name": "com.widevine.alpha",
    "options": {"licenseUrl": licenseServerUrl}
  }]
});

預先載入

您可以選擇許多設置來控制視頻數據的預加載。見播放器配置指南,預載部分有關完整的詳細信息。默認行為是Brightcove Player將預加載視頻元數據(例如標題和時長)以及幾秒鐘的視頻數據。如果要更改預加載行為,則可以在播放器配置中指定以下選項:

"preload": "none"

這是具有該設置的播放器配置的示例:

{
  "account_id": "3723496277001",
  "autoadvance": 0,
  "embed_id": "default",
  "player": {
    "template": {
      "name": "single-video-template",
      "version": "1.14.26"
    }
  },
  "player_id": "82f443bc-82f5-4074-bf9c-de2920c89b24",
  "player_name": "DRM Demo",
  "preload": "none",
  "scripts": [
    "https://players.brightcove.net/videojs-dash/videojs-dash.min.js"
  ],
  "stylesheets": [
    "https://players.brightcove.net/videojs-dash/videojs-dash.css"
  ],
  "video_cloud": {
    "policy_key": "BCpkADawqM2ENcgyE-9...EFGSP8b5dC",
    "video": null
  }
}