The Widevine CDM in browsers, as part of a normal license request process, can make a 2-byte request to the license server followed by the actual license request. See this comment here in Google's Shaka Player issues list ( https://github.com/google/shaka-player/issues/1814#issuecomment-468930207 ) that confirms this can be part of the license request process.
The promise returned from makeNewRequest does not take this into account. When listening to the message event on the keySession, the Widevine CDM will emit two message events, one with the 2-byte request (which I can only assume is part of the provisioning of the CDM) followed by the 'actual' license request which POSTs a much larger body to the license server.
keySession.addEventListener('message', (event) => {
// all other types will be handled by keystatuseschange
if (event.messageType !== 'license-request' && event.messageType !== 'license-renewal') {
return;
}
getLicense(options, event.message, contentId)
.then((license) => {
resolve(keySession.update(license));
})
.catch((err) => {
reject(err);
});
}, false);
(The event.messageType is license-request for both emitted events)
If the second 'actual' license request fails, the promise has been resolve'd and any further attempt to reject it to have it be thrown into the catch block and have it reported to emeError are ignored.
The Widevine CDM in browsers, as part of a normal license request process, can make a 2-byte request to the license server followed by the actual license request. See this comment here in Google's Shaka Player issues list ( https://github.com/google/shaka-player/issues/1814#issuecomment-468930207 ) that confirms this can be part of the license request process.
The promise returned from
makeNewRequest
does not take this into account. When listening to themessage
event on thekeySession
, the Widevine CDM will emit twomessage
events, one with the 2-byte request (which I can only assume is part of the provisioning of the CDM) followed by the 'actual' license request which POSTs a much larger body to the license server.https://github.com/videojs/videojs-contrib-eme/blob/main/src/eme.js#L113
(The
event.messageType
islicense-request
for both emitted events)If the second 'actual' license request fails, the promise has been
resolve
'd and any further attempt toreject
it to have it be thrown into thecatch
block and have it reported toemeError
are ignored.https://github.com/videojs/videojs-contrib-eme/blob/main/src/plugin.js#L237