@desynova-digital/player 3.10.0 → 3.10.1

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.
@@ -42,7 +42,8 @@ var propTypes = {
42
42
  player: _propTypes.PropTypes.instanceOf(Object),
43
43
  actions: _propTypes.PropTypes.instanceOf(Object),
44
44
  markers: _propTypes.PropTypes.instanceOf(Array),
45
- onTagClick: _propTypes.PropTypes.func
45
+ onTagClick: _propTypes.PropTypes.func,
46
+ playerType: _propTypes.PropTypes.string
46
47
  };
47
48
  var defaultProps = {
48
49
  player: {}
@@ -84,15 +85,22 @@ var PointersBar = /*#__PURE__*/function (_Component) {
84
85
  }
85
86
  }, {
86
87
  key: "onMarkerClick",
87
- value: function onMarkerClick(e, marker) {
88
+ value: function onMarkerClick(e, marker, index) {
88
89
  var _this$props = this.props,
89
90
  onTagClick = _this$props.onTagClick,
90
- actions = _this$props.actions;
91
+ actions = _this$props.actions,
92
+ playerType = _this$props.playerType;
91
93
  var start_time = parseFloat(e.target.getAttribute('leftpos'));
92
94
  var end_time = parseFloat(e.target.getAttribute('rightpos'));
93
95
  actions.handleMarkerUpdate(start_time, end_time);
94
96
  actions.pause();
95
97
  actions.seek(start_time);
98
+ if (playerType === 'subtitle') {
99
+ var scrollObject = {
100
+ tableListScrollTop: index
101
+ };
102
+ localStorage.setItem('scrollObject', JSON.stringify(scrollObject));
103
+ }
96
104
  onTagClick(start_time, end_time, marker);
97
105
  }
98
106
  }, {
@@ -191,7 +199,7 @@ var PointersBar = /*#__PURE__*/function (_Component) {
191
199
  return /*#__PURE__*/_react["default"].createElement("div", {
192
200
  className: "marker-blocks",
193
201
  onClick: function onClick(e) {
194
- _this3.onMarkerClick(e, marker);
202
+ _this3.onMarkerClick(e, marker, index);
195
203
  },
196
204
  onMouseOver: function onMouseOver(e) {
197
205
  self.setTooltipData(e, _this3.getTitle(marker));
@@ -259,22 +259,22 @@ var Video = /*#__PURE__*/function (_Component) {
259
259
  this.hls.on(_hls["default"].Events.ERROR, function (event, data) {
260
260
  // eslint-disable-next-line no-console
261
261
  console.log('HLS.Events.ERROR: ', event, data);
262
- switch (data.type) {
263
- case _hls["default"].ErrorTypes.NETWORK_ERROR:
264
- // try to recover network error
265
- _this2.hls.startLoad();
266
- break;
267
- case _hls["default"].ErrorTypes.MEDIA_ERROR:
268
- _this2.hls.recoverMediaError();
269
- break;
270
- default:
271
- // cannot recover
272
- if (data.details === 'internalException' && data.type === 'otherError') {
262
+ if (data.fatal) {
263
+ switch (data.type) {
264
+ case _hls["default"].ErrorTypes.NETWORK_ERROR:
265
+ // try to recover network error
273
266
  _this2.hls.startLoad();
274
- } else {
267
+ break;
268
+ case _hls["default"].ErrorTypes.MEDIA_ERROR:
269
+ _this2.hls.recoverMediaError();
270
+ break;
271
+ default:
272
+ // cannot recover
275
273
  _this2.hls.destroy();
276
- }
277
- break;
274
+ break;
275
+ }
276
+ } else if (data.details === 'internalException' && data.type === 'otherError') {
277
+ _this2.hls.startLoad();
278
278
  }
279
279
  });
280
280
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desynova-digital/player",
3
- "version": "3.10.0",
3
+ "version": "3.10.1",
4
4
  "description": "Video Player Package for Contido Application",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -51,13 +51,17 @@ var initialState = {
51
51
  HLSConfig: {
52
52
  debug: true,
53
53
  capLevelToPlayerSize: false,
54
- maxBufferLength: 10,
54
+ maxBufferLength: 30,
55
55
  maxMaxBufferLength: 600,
56
- maxBufferSize: 30,
56
+ maxBufferSize: 60,
57
57
  enableWebVTT: false,
58
- enableCEA708Captions: false
58
+ enableCEA708Captions: false,
59
+ enableWorker: true,
60
+ // Enable the worker for better performance
61
+ enableStashBuffer: true // Enable stash buffer for adaptive bitrate streaming
59
62
  }
60
63
  };
64
+
61
65
  function player() {
62
66
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
63
67
  var action = arguments.length > 1 ? arguments[1] : undefined;