Skip to content

Commit

Permalink
Extends the License Request Complete event to include the original se…
Browse files Browse the repository at this point in the history
…rver response when DRM errors are reported
  • Loading branch information
Wilhelm Faber authored and WilhelmFaber committed Jul 7, 2022
1 parent 53c418d commit 2ff9d5e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/streaming/protection/controllers/ProtectionController.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,10 +984,23 @@ function ProtectionController(config) {
* @private
*/
function _reportError(xhr, eventData, keySystemString, messageType, licenseServerData) {
const errorMsg = ((xhr.response) ? licenseServerData.getErrorResponse(xhr.response, keySystemString, messageType) : 'NONE');
let errorMsg = 'NONE';
let data = null;

if (xhr.response) {
errorMsg = licenseServerData.getErrorResponse(xhr.response, keySystemString, messageType);
data = {
serverResponse: xhr.response || null,
responseCode: xhr.status || null,
responseText: xhr.statusText || null
}
}

_sendLicenseRequestCompleteEvent(eventData, new DashJSError(ProtectionErrors.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,
ProtectionErrors.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE + keySystemString + ' update, XHR complete. status is "' +
xhr.statusText + '" (' + xhr.status + '), readyState is ' + xhr.readyState + '. Response is ' + errorMsg));
xhr.statusText + '" (' + xhr.status + '), readyState is ' + xhr.readyState + '. Response is ' + errorMsg,
data
));
}

/**
Expand Down

0 comments on commit 2ff9d5e

Please sign in to comment.