@srgssr/pillarbox-web 1.15.0 → 1.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,7 +107,7 @@ function _objectWithoutProperties(source, excluded) {
107
107
  return target;
108
108
  }
109
109
 
110
- const version = "1.14.1";
110
+ const version = "1.15.1";
111
111
 
112
112
  /**
113
113
  * @ignore
@@ -1890,7 +1890,7 @@ class PillarboxMonitoring {
1890
1890
  this.sendEvent('ERROR', _objectSpread2(_objectSpread2({
1891
1891
  log: JSON.stringify(error.metadata || pillarbox.log.history().slice(-15)),
1892
1892
  message: error.message,
1893
- name: error.code
1893
+ name: PillarboxMonitoring.errorKeyCode(error.code)
1894
1894
  }, playbackPosition), {}, {
1895
1895
  url
1896
1896
  }));
@@ -2402,6 +2402,20 @@ class PillarboxMonitoring {
2402
2402
  };
2403
2403
  }
2404
2404
 
2405
+ /**
2406
+ * Returns a string representing the error key combined with its error code.
2407
+ *
2408
+ * If the error code doesn't exist the error key undefined.
2409
+ *
2410
+ * @param {number} code The error code
2411
+ *
2412
+ * @returns {string} The error key combined with its error code
2413
+ */
2414
+ static errorKeyCode(code) {
2415
+ const error = ['MEDIA_ERR_CUSTOM', ...Object.keys(window.MediaError), 'MEDIA_ERR_ENCRYPTED'];
2416
+ return `${error[code]}: ${code}`;
2417
+ }
2418
+
2405
2419
  /**
2406
2420
  * Generates a new session ID.
2407
2421
  *