From f2a96a0c28485a6e5021c5096d5d9f8d7061ac45 Mon Sep 17 00:00:00 2001 From: Adam Waldron Date: Tue, 27 Feb 2024 20:18:27 -0800 Subject: [PATCH] remove extra error function --- src/plugin.js | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 7723ea6..1cc2ef8 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -188,12 +188,13 @@ export const setupSessions = (player) => { */ export const emeErrorHandler = (player) => { return (objOrErr) => { + const vjsErrorType = videojs.Error && videojs.Error.EMEKeySessionCreationError; + const errorType = vjsErrorType || 'eme-key-session-creation-error'; const error = { // MEDIA_ERR_ENCRYPTED is code 5 - code: 5 + code: 5, + errorType }; - const vjsErrorType = videojs.Error && videojs.Error.EMEKeySessionCreationError; - const errorType = vjsErrorType || 'eme-key-session-creation-error'; if (typeof objOrErr === 'string') { error.message = objOrErr; @@ -209,10 +210,7 @@ export const emeErrorHandler = (player) => { } player.error(error); - player.eme.error({ - errorType, - error - }); + player.trigger('vjsemeerror'); }; }; @@ -410,27 +408,7 @@ const eme = function(options = {}) { }); }, detectSupportedCDMs, - options, - _error: null, - error(err) { - - // If `err` doesn't exist, return the current error. - if (err === undefined) { - return this._error || null; - } - - // If `err` is null, reset the ads error. - if (err === null) { - this._error = null; - - return; - } - - this._error = err; - - videojs.log.error(`EME error occured of type: ${err.errorType}.`); - player.trigger('vjsemeerror'); - } + options }; };