Skip to content

Commit

Permalink
add error type fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
adrums86 committed Feb 27, 2024
1 parent bae0cba commit 137809a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ export const emeErrorHandler = (player) => {
// MEDIA_ERR_ENCRYPTED is code 5
code: 5
};
const vjsErrorType = videojs.Error && videojs.Error.EMEKeySessionCreationError;
const errorType = vjsErrorType || 'eme-key-session-creation-error';

if (typeof objOrErr === 'string') {
error.message = objOrErr;
Expand All @@ -208,7 +210,7 @@ export const emeErrorHandler = (player) => {

player.error(error);
player.eme.error({
errorType: videojs.Error.EMEKeySessionCreationError,
errorType,
error
});
};
Expand Down

0 comments on commit 137809a

Please sign in to comment.