HLS Fairplay DRM 内容 videojs 返回Failed to load resource: Origin https:// is not allowed by Access-Control-Allow-Origin
。在尝试获得 HLS fairplay 的许可证时。
我正在使用 Videojs 版本 @7.5.5 和 videojs-contrib-eme 版本 @3.5.4
player.src({
// normal Video.js src and type options
src: streamUri,
type: 'application/x-mpegURL',
keySystems: {
"com.apple.fps.1_0": {
certificateUri: certificateUri,
getLicense: function (emeOptions, contentId, keyMessage, callback) {
videojs.xhr({
uri: licenceUri,
method: 'POST',
responseType: 'arraybuffer',
body: keyMessage,
headers: {
'Content-type': 'application/octet-stream',
'utoken-drm': 'fp'
}
}, function (err, response, responseBody) {
if (err) {
callback(err);
return;
}
callback(null, responseBody);
});
}
}
}
});
player.play();'''