@srgssr/pillarbox-web 1.15.1 → 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.
@@ -3,7 +3,7 @@
3
3
  const videojs = require('video.js');
4
4
  require('videojs-contrib-eme');
5
5
 
6
- const version = "1.15.0";
6
+ const version = "1.15.1";
7
7
 
8
8
  /**
9
9
  * @ignore
@@ -1,7 +1,7 @@
1
1
  import videojs from 'video.js';
2
2
  import 'videojs-contrib-eme';
3
3
 
4
- const version = "1.15.0";
4
+ const version = "1.15.1";
5
5
 
6
6
  /**
7
7
  * @ignore
@@ -109,7 +109,7 @@ function _objectWithoutProperties(source, excluded) {
109
109
  return target;
110
110
  }
111
111
 
112
- const version = "1.15.0";
112
+ const version = "1.15.1";
113
113
 
114
114
  /**
115
115
  * @ignore
@@ -1892,7 +1892,7 @@ class PillarboxMonitoring {
1892
1892
  this.sendEvent('ERROR', _objectSpread2(_objectSpread2({
1893
1893
  log: JSON.stringify(error.metadata || pillarbox.log.history().slice(-15)),
1894
1894
  message: error.message,
1895
- name: error.code
1895
+ name: PillarboxMonitoring.errorKeyCode(error.code)
1896
1896
  }, playbackPosition), {}, {
1897
1897
  url
1898
1898
  }));
@@ -2404,6 +2404,20 @@ class PillarboxMonitoring {
2404
2404
  };
2405
2405
  }
2406
2406
 
2407
+ /**
2408
+ * Returns a string representing the error key combined with its error code.
2409
+ *
2410
+ * If the error code doesn't exist the error key undefined.
2411
+ *
2412
+ * @param {number} code The error code
2413
+ *
2414
+ * @returns {string} The error key combined with its error code
2415
+ */
2416
+ static errorKeyCode(code) {
2417
+ const error = ['MEDIA_ERR_CUSTOM', ...Object.keys(window.MediaError), 'MEDIA_ERR_ENCRYPTED'];
2418
+ return `${error[code]}: ${code}`;
2419
+ }
2420
+
2407
2421
  /**
2408
2422
  * Generates a new session ID.
2409
2423
  *