Open Dardaxe opened 5 years ago
Unfortunately, we have seen the same issue. We will be (hopefully) working on a fix in the near term for this vendor as it works out of the box when using Dash.js.
@Dardaxe Took another look at this issue as we were dealing with the same error message. Our implementation for our PlayReady DRM provider (built on top of contrib-eme) looks like this (cleaned up so as not to leak private stuff):
getLicense(emeOptions, keyMessage, callback) {
// This is very much the same as your getMessageContents function.
const parsed = parseKeyMessage(keyMessage);
videojs.xhr({
uri: URL_TO_PROVIDER,
method: 'POST',
body: parsed.body,
headers: parsed.headers,
responseType: 'arraybuffer'
}, (err, response, body) => {
if (err) {
callback(err);
return;
}
callback(null, body);
});
}
Switching how callback
is used may be all you need.
@misteroneill Thanks for your answer and those information !
I've updated videojs-contrib-eme to version 3.5.4 and changed how callback is used. It looks like this now :
getLicense: function (emeOptions, keyMessage, callback) {
console.log('Playready GetLicense')
const {headers, message} = getMessageContents(keyMessage)
videojs.xhr({
url: 'DRM_PROVIDER_URL',
method: 'POST',
body: message,
headers: headers,
responseType: 'arraybuffer'
}, (err, response, responseBody) => {
if (err) {
callback(err)
return
}
console.log('License correctly recovered')
callback(null, responseBody)
})
}
Unfortunately I'm still getting the same problem: It seems that I'm correctly retrieving the license but it's never set on the player
Calls to my DRM Provider are successfull :
Console log show the same information :
I can see them being delivered in my DRM Provider Back office, no problem with that.
Do you think that I need to manually call a specific function to set license on the player ?
I've made a reduced test case, illustrating my problem : https://jsbin.com/wutalosima/edit?html,console,output
Furthermore, it seems like the first request to the DRM Provider have the custom headers I need but the retried requests don't.
Hi, I'm trying to play a Dash encoded video with PlayReady DRM and I have some problems with it. As my DRM provider needs a custom header to be passed in the header of the license request I've made this code for the request :
getLicense
getMessageContents
I'm able to correctly get the license. I can see the license being delivered through my DRM Provider Dashboard and through the network tab in my browser.
However i'm still having this error in my console :
Here's a link to a test page (Dash PlayReady only compatible with IE/Edge)
Have I missed something in my implementation ? Thanks