hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Provide the license XHR object or fetch response with KEY_SYSTEM_LICENSE_REQUEST_FAILED error data

Open pcruiksh opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Some DRM servers provide error details in non-2xx responses that may be useful to applications for error handling and retry logic, especially for applications that already wrap the license request/response flow with custom logic. In my case, our license server may indicate that one of several tokens sent in the request body needs to be refreshed but the error is otherwise recoverable.

I acknowledge that this is solve-able if you are wrapping the license request with a licenseXhrSetup callback, but it makes error handling a bit clumsier than it needs to be.

Describe the solution you'd like

Pass the xhr object as part of the error data when a KEY_SYSTEM_LICENSE_REQUEST_FAILED error is triggered.

Additional context

No response

pcruiksh avatar Feb 02 '22 19:02 pcruiksh

Hi @pcruiksh,

~Please create a PR that adds networkDetails: xhr to the error object, and update necessary TS type defs and API.md documention.~

This issue will be addressed by #4930

robwalch avatar Jul 14 '22 22:07 robwalch

This is available in v1.3.0-beta.1.

robwalch avatar Dec 18 '22 03:12 robwalch