Skip to content

Commit

Permalink
Dispatch error when KEY_ERROR occurs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Jul 22, 2021
1 parent 88e06a5 commit fb14331
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/streaming/protection/models/ProtectionModel_01b.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function ProtectionModel_01b(config) {
}
msg += ' System Code = ' + event.systemCode;
// TODO: Build error string based on key error
eventBus.trigger(events.KEY_ERROR, { data: new DashJSError(code, msg, sessionToken) });
eventBus.trigger(events.KEY_ERROR, { error: new DashJSError(code, msg, sessionToken) });
} else {
logger.error('No session token found for key error');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function ProtectionModel_21Jan2015(config) {
eventBus.trigger(events.KEY_SESSION_UPDATED);
})
.catch(function (error) {
eventBus.trigger(events.KEY_ERROR, {data: new DashJSError(ProtectionErrors.MEDIA_KEYERR_CODE, 'Error sending update() message! ' + error.name, sessionToken)});
eventBus.trigger(events.KEY_ERROR, {error: new DashJSError(ProtectionErrors.MEDIA_KEYERR_CODE, 'Error sending update() message! ' + error.name, sessionToken)});
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ function ProtectionModel_3Feb2014(config) {
switch (event.type) {
case api.error:
let errorStr = 'KeyError'; // TODO: Make better string from event
eventBus.trigger(events.KEY_ERROR, { data: new DashJSError(ProtectionErrors.MEDIA_KEYERR_CODE, errorStr, this) });
eventBus.trigger(events.KEY_ERROR, { error: new DashJSError(ProtectionErrors.MEDIA_KEYERR_CODE, errorStr, this) });
break;
case api.message:
let message = ArrayBuffer.isView(event.message) ? event.message.buffer : event.message;
Expand Down

0 comments on commit fb14331

Please sign in to comment.