Skip to content

Commit

Permalink
fix: Do not make LICENSE_REQUEST_FAILED fatal if other keys are succe…
Browse files Browse the repository at this point in the history
…ssful (#6457)

Fixes #3051
  • Loading branch information
avelad authored Apr 23, 2024
1 parent d570ae1 commit a6c748a
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,9 @@ shaka.media.DrmEngine = class {
const req = this.playerInterface_.netEngine.request(requestType, request);
response = await req.promise;
} catch (error) {
if (this.destroyer_.destroyed()) {
return;
}
// Request failed!
goog.asserts.assert(error instanceof shaka.util.Error,
'Wrong NetworkingEngine error type!');
Expand All @@ -1514,9 +1517,20 @@ shaka.media.DrmEngine = class {
shaka.util.Error.Category.DRM,
shaka.util.Error.Code.LICENSE_REQUEST_FAILED,
error);
this.onError_(shakaErr);
if (metadata && metadata.updatePromise) {
metadata.updatePromise.reject(shakaErr);
if (this.activeSessions_.size == 1) {
this.onError_(shakaErr);
if (metadata && metadata.updatePromise) {
metadata.updatePromise.reject(shakaErr);
}
} else {
if (metadata && metadata.updatePromise) {
metadata.updatePromise.reject(shakaErr);
}
this.activeSessions_.delete(session);
if (this.areAllSessionsLoaded_()) {
this.allSessionsLoaded_.resolve();
this.keyStatusTimer_.tickAfter(/* seconds= */ 0.1);
}
}
return;
}
Expand Down

0 comments on commit a6c748a

Please sign in to comment.