Reputation: 329
I have DRM content [with Fairplay license URL and certificate URL], and I need to integrate this into the Safari browser Sometimes my license URL and certificate URL get called and the content plays smoothly, but sometimes, my custom license URL and certificate method don't get invoked, and because of this video js throws an error video.js: 7.20.1 videojs-contrib-eme: 4.0.0 Has anyone experienced something similar and found a workaround? I have attached a code snippet, of how I am trying to call my license URL for the Safari browser
player.src({
src: playerSrc.src,
type: 'application/x-mpegURL',
withCredentials: true,
keySystems: {
'com.apple.fps.1_0': {
getCertificate: function (emeOptions, callback) {
callback(
null,base64DecodeUint8Array(playerSrc?.certificateData)
);
},
getContentId: function (emeOptions, initData, eme) {
fairplayLicenseUri =
'https://' + initData.split('skd://').pop();
var contentId = fairplayLicenseUri.split('/').pop();
return contentId;
},
getLicense: function (emeOptions, contentId, keyMessage, callback ) {
videojs.xhr({
url: playerSrc.licenseUri,
method: 'POST',
responseType: 'arraybuffer',
body: keyMessage,
headers: {
'Content-type': 'application/octet-stream',
},
},(err, response, responseBody) => {
if (err) {
callback(err);
return;
}
callback(null, responseBody);
});},},
},
});
Upvotes: 0
Views: 109