适用于Playready Widevine和Fairplay的VideoJS配置

时间:2018-12-11 21:43:13

标签: browser video.js drm widevine playready

我有videoJS在Widevine上工作,并且可以播放,我也有videojs在Fairplay上工作。这是两个单独的工作页面,但我想将它们结合起来。有一个Bitmovin的示例,以及如何组合所有来源以使其在所有浏览器上均可使用。我在videoJS中尝试了类似的操作,但是无法正常工作。您能给我一个类似的布局来简化事情吗?

var conf = {
  key: "YOUR-PLAYER-KEY-HERE",
  source: {
    dash: "DASH_MANIFEST_URL",
    hls: "HLS_MANIFEST_URL",
    drm: {
      playready: {
        LA_URL: "http://sldrm.licensekeyserver.com/core/rightsmanager.asmx",
        headers : [{
          name: "customdata",
          value: "BASE64_ENCODED_CUSTOM_DATA";
        }]
      },
      widevine: {
        LA_URL: "http://widevine.licensekeyserver.com",
        headers : [{
          name: "customdata",
          value: "BASE64_ENCODED_CUSTOM_DATA";
        }]
      },
      fairplay: {
        LA_URL: "https://fp-keyos.licensekeyserver.com/getkey",
        certificateURL: "CERTIFICATE_URL",
        headers: [{
          name: "customdata",
          value: "BASE64_ENCODED_CUSTOM_DATA"
        }],
        prepareMessage : function(event, session) {
          return "spc=" + encodeURIComponent(event.messageBase64Encoded) + "&assetId=" + session.contentId;
        },
        prepareContentId : function(contentId) {
          var idx = contentId.indexOf("skd://");
          if (idx > -1) {
            return contentId.substring(8, 40);
          }

          throw "Invalid Content ID format. The format of the Content ID must be the following: skd://xxx where xxx is the Key ID in hex format.";
        }
      }
    }
  }
};

0 个答案:

没有答案