@desynova-digital/player 4.0.88 → 4.0.89

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.
package/actions/player.js CHANGED
@@ -232,22 +232,23 @@ function toggleFullscreen(player) {
232
232
  }
233
233
  function toggleRightBar(player, showRightMenu) {
234
234
  var right = document.querySelector('.right-video-section');
235
+ var sidebarWidth = right.offsetWidth; // actual width of sidebar
235
236
  // Already fullscreen → toggle UI only (NO EXIT)
236
237
  if (_fullscreen["default"].isFullscreen) {
237
238
  right.style.transition = 'transform 0.4s ease, opacity 0.3s ease';
238
239
  if (showRightMenu) {
239
240
  // ✅ Coming from right to left (enter animation)
240
241
  right.style.display = 'block';
241
- right.style.transform = 'translateX(100%)'; // start off-screen right
242
+ right.style.right = "-".concat(sidebarWidth, "px"); // start off-screen
242
243
  right.style.opacity = '0';
243
244
  // Small delay to allow the browser to register initial position
244
245
  requestAnimationFrame(function () {
245
- right.style.transform = 'translateX(0)'; // slide in
246
+ right.style.right = '0px'; // slide in
246
247
  right.style.opacity = '1';
247
248
  });
248
249
  } else {
249
250
  // ✅ Going left to right (exit animation)
250
- right.style.transform = 'translateX(100%)'; // slide out to right
251
+ right.style.right = "-".concat(sidebarWidth, "px"); // start off-screen
251
252
  right.style.opacity = '0';
252
253
  // Hide after animation completes
253
254
  setTimeout(function () {
@@ -200,11 +200,13 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
200
200
  _classCallCheck(this, Player);
201
201
  _this = _callSuper(this, Player, [props]);
202
202
  _defineProperty(_this, "closeSidemenu", function () {
203
- var _this$props = _this.props,
204
- player = _this$props.player,
205
- onRightMenuVisible = _this$props.onRightMenuVisible;
206
- _this.actions.toggleRightBar(player, false);
207
- onRightMenuVisible(false);
203
+ var _this$manager$getStat = _this.manager.getState(),
204
+ player = _this$manager$getStat.player;
205
+ var onRightMenuVisible = _this.props.onRightMenuVisible;
206
+ if (player !== null && player !== void 0 && player.isFullscreen) {
207
+ _this.actions.toggleRightBar(player, false);
208
+ onRightMenuVisible(false);
209
+ }
208
210
  });
209
211
  _this.controlsHideTimer = null;
210
212
  _this.meterHeight = 40;
@@ -228,9 +230,9 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
228
230
  return _createClass(Player, [{
229
231
  key: "handleMarginsAndGrid",
230
232
  value: function handleMarginsAndGrid() {
231
- var _this$props2 = this.props,
232
- quality = _this$props2.quality,
233
- playerType = _this$props2.playerType;
233
+ var _this$props = this.props,
234
+ quality = _this$props.quality,
235
+ playerType = _this$props.playerType;
234
236
  if (['snp_edit', 'promo_review', 'pgm_edit', 'dubbing_review'].includes(playerType)) {
235
237
  this.actions.handleSDBorderChange({
236
238
  key: 'fourThreeSafeArea',
@@ -329,10 +331,10 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
329
331
  }, {
330
332
  key: "componentDidUpdate",
331
333
  value: function componentDidUpdate(prevProps, prevState) {
332
- var _this$props3 = this.props,
333
- playerType = _this$props3.playerType,
334
- activeSDBorder = _this$props3.activeSDBorder,
335
- activeVersion = _this$props3.activeVersion;
334
+ var _this$props2 = this.props,
335
+ playerType = _this$props2.playerType,
336
+ activeSDBorder = _this$props2.activeSDBorder,
337
+ activeVersion = _this$props2.activeVersion;
336
338
  this.handleResize();
337
339
  if (activeSDBorder !== prevProps.activeSDBorder) {
338
340
  this.actions.handleSDBorderChange(activeSDBorder || false);
@@ -377,20 +379,20 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
377
379
  _fullProps$player2,
378
380
  _fullProps$player3,
379
381
  _tabMetadata$edit_dat;
380
- var _this$props4 = this.props,
381
- playerSvgRef = _this$props4.playerSvgRef,
382
- parentAnnotations = _this$props4.parentAnnotations,
383
- onShapeMouseDown = _this$props4.onShapeMouseDown,
384
- handleMouseDown = _this$props4.handleMouseDown,
385
- handleMouseMove = _this$props4.handleMouseMove,
386
- handleMouseUp = _this$props4.handleMouseUp,
387
- isSvgLayer = _this$props4.isSvgLayer,
388
- inTime = _this$props4.inTime,
389
- outTime = _this$props4.outTime,
390
- isRightMenuVisible = _this$props4.isRightMenuVisible,
391
- tabMetadata = _this$props4.tabMetadata,
392
- player = _this$props4.player,
393
- onRightMenuVisible = _this$props4.onRightMenuVisible;
382
+ var _this$props3 = this.props,
383
+ playerSvgRef = _this$props3.playerSvgRef,
384
+ parentAnnotations = _this$props3.parentAnnotations,
385
+ onShapeMouseDown = _this$props3.onShapeMouseDown,
386
+ handleMouseDown = _this$props3.handleMouseDown,
387
+ handleMouseMove = _this$props3.handleMouseMove,
388
+ handleMouseUp = _this$props3.handleMouseUp,
389
+ isSvgLayer = _this$props3.isSvgLayer,
390
+ inTime = _this$props3.inTime,
391
+ outTime = _this$props3.outTime,
392
+ isRightMenuVisible = _this$props3.isRightMenuVisible,
393
+ tabMetadata = _this$props3.tabMetadata,
394
+ player = _this$props3.player,
395
+ onRightMenuVisible = _this$props3.onRightMenuVisible;
394
396
  return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
395
397
  ref: function ref(c) {
396
398
  _this2._playerHeader = c;
@@ -456,14 +458,13 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
456
458
  playerType: fullProps.playerType
457
459
  }, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
458
460
  key: "shortcut",
459
- order: 99.0
460
- }, props, {
461
461
  pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
462
462
  playerType: fullProps.playerType,
463
463
  frameRate: fullProps.frameRate,
464
464
  isRightMenuVisible: isRightMenuVisible,
465
- onRightMenuVisible: onRightMenuVisible
466
- }))];
465
+ onRightMenuVisible: onRightMenuVisible,
466
+ order: 99.0
467
+ }, props))];
467
468
  }
468
469
  }, {
469
470
  key: "getImageChildren",
@@ -503,20 +504,21 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
503
504
  key: "getAdvancedChildren",
504
505
  value: function getAdvancedChildren(props, fullProps) {
505
506
  var _this4 = this;
506
- var _this$props5 = this.props,
507
- playerSvgRef = _this$props5.playerSvgRef,
508
- parentAnnotations = _this$props5.parentAnnotations,
509
- onShapeMouseDown = _this$props5.onShapeMouseDown,
510
- handleMouseDown = _this$props5.handleMouseDown,
511
- handleMouseMove = _this$props5.handleMouseMove,
512
- handleMouseUp = _this$props5.handleMouseUp,
513
- isSvgLayer = _this$props5.isSvgLayer,
514
- inTime = _this$props5.inTime,
515
- outTime = _this$props5.outTime,
516
- tabMetadata = _this$props5.tabMetadata,
517
- isRightMenuVisible = _this$props5.isRightMenuVisible,
518
- isFullscreen = _this$props5.isFullscreen,
519
- player = _this$props5.player;
507
+ var _this$props4 = this.props,
508
+ playerSvgRef = _this$props4.playerSvgRef,
509
+ parentAnnotations = _this$props4.parentAnnotations,
510
+ onShapeMouseDown = _this$props4.onShapeMouseDown,
511
+ handleMouseDown = _this$props4.handleMouseDown,
512
+ handleMouseMove = _this$props4.handleMouseMove,
513
+ handleMouseUp = _this$props4.handleMouseUp,
514
+ isSvgLayer = _this$props4.isSvgLayer,
515
+ inTime = _this$props4.inTime,
516
+ outTime = _this$props4.outTime,
517
+ tabMetadata = _this$props4.tabMetadata,
518
+ isRightMenuVisible = _this$props4.isRightMenuVisible,
519
+ isFullscreen = _this$props4.isFullscreen,
520
+ player = _this$props4.player,
521
+ onRightMenuVisible = _this$props4.onRightMenuVisible;
520
522
  return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
521
523
  ref: function ref(c) {
522
524
  _this4._playerHeader = c;
@@ -550,12 +552,13 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
550
552
  playerType: fullProps.playerType
551
553
  }, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
552
554
  key: "shortcut",
553
- order: 99.0
554
- }, props, {
555
+ pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
555
556
  playerType: fullProps.playerType,
556
557
  frameRate: fullProps.frameRate,
557
- pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect
558
- }))];
558
+ isRightMenuVisible: isRightMenuVisible,
559
+ onRightMenuVisible: onRightMenuVisible,
560
+ order: 99.0
561
+ }, props))];
559
562
  }
560
563
  }, {
561
564
  key: "getChildren",
@@ -713,8 +716,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
713
716
  }, {
714
717
  key: "handleResize",
715
718
  value: function handleResize() {
716
- var _this$manager$getStat = this.manager.getState(),
717
- player = _this$manager$getStat.player;
719
+ var _this$manager$getStat2 = this.manager.getState(),
720
+ player = _this$manager$getStat2.player;
718
721
  var leftSectionRef = this._leftSectionRef;
719
722
  var rightSectionRef = this._rightSectionRef;
720
723
  var audioMeterBlock = this._audioMeterBlock;
@@ -724,11 +727,11 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
724
727
  var controlBar = (0, _reactDom.findDOMNode)(this._controlBar);
725
728
  var playlist = (0, _reactDom.findDOMNode)(this._playlist);
726
729
  var playerContainer = (0, _reactDom.findDOMNode)(this._playerContainer);
727
- var _this$props6 = this.props,
728
- controlType = _this$props6.controlType,
729
- playerType = _this$props6.playerType,
730
- fileType = _this$props6.fileType,
731
- isRightMenuVisible = _this$props6.isRightMenuVisible;
730
+ var _this$props5 = this.props,
731
+ controlType = _this$props5.controlType,
732
+ playerType = _this$props5.playerType,
733
+ fileType = _this$props5.fileType,
734
+ isRightMenuVisible = _this$props5.isRightMenuVisible;
732
735
 
733
736
  //added for header height
734
737
  var headerHeight = playerHeader ? playerHeader.offsetHeight : 60;
@@ -871,8 +874,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
871
874
  key: "render",
872
875
  value: function render() {
873
876
  var _this5 = this;
874
- var _this$manager$getStat2 = this.manager.getState(),
875
- player = _this$manager$getStat2.player;
877
+ var _this$manager$getStat3 = this.manager.getState(),
878
+ player = _this$manager$getStat3.player;
876
879
  var props = _objectSpread(_objectSpread({}, this.props), {}, {
877
880
  player: player,
878
881
  actions: this.actions,
@@ -881,12 +884,12 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
881
884
  video: this.video ? this.video.video : null
882
885
  });
883
886
  var childrensLeft = this.getChildren(props, 'left');
884
- var _this$props7 = this.props,
885
- rightSection = _this$props7.rightSection,
886
- playerType = _this$props7.playerType,
887
- isFullscreen = _this$props7.isFullscreen,
888
- tabMetadata = _this$props7.tabMetadata,
889
- isRightMenuVisible = _this$props7.isRightMenuVisible;
887
+ var _this$props6 = this.props,
888
+ rightSection = _this$props6.rightSection,
889
+ playerType = _this$props6.playerType,
890
+ isFullscreen = _this$props6.isFullscreen,
891
+ tabMetadata = _this$props6.tabMetadata,
892
+ isRightMenuVisible = _this$props6.isRightMenuVisible;
890
893
  return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
891
894
  ref: function ref(c) {
892
895
  _this5.manager.rootElement = c;
@@ -211,7 +211,8 @@ var PointersBar = exports["default"] = /*#__PURE__*/function (_Component) {
211
211
  var _this3 = this;
212
212
  var _this$props3 = this.props,
213
213
  markers = _this$props3.markers,
214
- zoom = _this$props3.zoom;
214
+ zoom = _this$props3.zoom,
215
+ isFullscreen = _this$props3.player.isFullscreen;
215
216
  var _this$state = this.state,
216
217
  _this$state$tooltip = _this$state.tooltip,
217
218
  isVisible = _this$state$tooltip.isVisible,
@@ -227,7 +228,7 @@ var PointersBar = exports["default"] = /*#__PURE__*/function (_Component) {
227
228
  var scrollTop = e.target.scrollTop;
228
229
  _this3.props.onScroll(scrollTop);
229
230
  }
230
- }, markers && markers.length ? markers.map(function (marker_obj) {
231
+ }, !isFullscreen && markers && markers.length ? markers.map(function (marker_obj) {
231
232
  return /*#__PURE__*/_react["default"].createElement(PointersContainer, {
232
233
  id: "pointers-block",
233
234
  ref: function ref(c) {
@@ -38,20 +38,20 @@ var MarkerLine = _styledComponents["default"].div(_templateObject4 || (_template
38
38
  /* ----------------------------------------------------------
39
39
  HOVER BOX
40
40
  ---------------------------------------------------------- */
41
- var HoverBox = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 30px;\n left: var(--left);\n transform: translateX(-50%);\n // width: auto;\n min-width: 150px;\n max-width: 220px;\n max-height: 400px;\n background: #303f51;\n backdrop-filter: blur(12px);\n border-radius: 10px;\n padding: ", ";\n color: white;\n z-index: 999999;\n box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);\n font-family: 'Inter', 'SF Pro Display', 'Segoe UI', sans-serif;\n overflow-y: auto;\n animation: fadeInBox 0.18s ease-out;\n"])), function (props) {
41
+ var HoverBox = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 30px;\n left: var(--left);\n transform: translateX(-50%);\n // width: auto;\n min-width: 150px;\n max-width: 220px;\n max-height: 400px;\n background: #303f51;\n backdrop-filter: blur(12px);\n border-radius: 10px;\n padding: ", ";\n color: white;\n z-index: 999999;\n box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);\n font-family: 'SF Pro Text';\n overflow-y: auto;\n animation: fadeInBox 0.18s ease-out;\n"])), function (props) {
42
42
  return props.commentLength > 1 ? '0px 9px 8px 4px' : '10px 9px 8px 4px';
43
43
  });
44
44
  var HoverHeader = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: calc(100% + 18px);\n position: relative;\n left: -9px;\n background: #3e6673;\n color: #46d7ff;\n font-size: 12px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n padding: 10px 12px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n margin-bottom: 8px;\n"])));
45
45
  var HoverComment = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 10px 0;\n position: relative;\n border-radius: 5px;\n transition: background 0.15s ease, transform 0.15s ease;\n &:hover {\n background: rgba(255, 255, 255, 0.08); /* subtle highlight */\n transform: translateX(2px); /* slight movement */\n }\n &:not(:last-child)::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: -9px;\n width: calc(100% + 18px);\n height: 1px;\n background: rgba(255, 255, 255, 0.12);\n }\n"])));
46
46
  var HoverName = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n font-size: 13px;\n font-weight: 700;\n color: #afb2ba;\n margin-bottom: 8px;\n"])));
47
47
  var HoverTime = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: 11px;\n color: #afb2ba;\n margin-bottom: 5px;\n"])));
48
- var HoverText = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n font-size: 13px;\n color: #fff;\n line-height: 1.35;\n display: -webkit-box;\n -webkit-line-clamp: 4;\n -webkit-box-orient: vertical;\n overflow: hidden;\n"])));
48
+ var HoverText = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n font-size: 14px;\n font-family: 'SF Pro Text';\n color: #fff;\n line-height: 1.35;\n display: -webkit-box;\n -webkit-line-clamp: 4;\n -webkit-box-orient: vertical;\n overflow: hidden;\n font-weight: 300;\n line-height: 21px;\n font-style: normal;\n"])));
49
49
 
50
50
  /* ----------------------------------------------------------
51
51
  SAFE LEFT POSITION
52
52
  ---------------------------------------------------------- */
53
53
  var getSafeLeft = function getSafeLeft(percent) {
54
- if (percent < 5) return 5;
54
+ if (percent < 3) return 3;
55
55
  if (percent > 95) return 95;
56
56
  return percent;
57
57
  };
@@ -123,6 +123,19 @@ var RenderCommentMarkers = function RenderCommentMarkers(props) {
123
123
  var end = comments[0].value.out_time;
124
124
  var startPercent = getMarkerPercent(start, duration, zoom);
125
125
  var endPercent = end ? getMarkerPercent(end, duration, zoom) : null;
126
+
127
+ // --- NEW: detect first & last markers ---
128
+ var times = Object.keys(grouped).map(Number).sort(function (a, b) {
129
+ return a - b;
130
+ });
131
+ var firstTime = times[0];
132
+ var lastTime = times[times.length - 1];
133
+ var isFirst = Number(time) === firstTime;
134
+ var isLast = Number(time) === lastTime;
135
+
136
+ // --- NEW: apply safe-left/right only to first & last ---
137
+ var safeStart = isFirst ? getSafeLeft(startPercent) : startPercent;
138
+ var safeEnd = isLast && endPercent !== null ? getSafeLeft(endPercent) : endPercent;
126
139
  var initials = ((_comments$ = comments[0]) === null || _comments$ === void 0 || (_comments$ = _comments$.value) === null || _comments$ === void 0 || (_comments$ = _comments$.created_by) === null || _comments$ === void 0 || (_comments$ = _comments$.name) === null || _comments$ === void 0 || (_comments$ = _comments$.split(' ')) === null || _comments$ === void 0 || (_comments$ = _comments$.map(function (n) {
127
140
  return n[0];
128
141
  })) === null || _comments$ === void 0 || (_comments$ = _comments$.join('')) === null || _comments$ === void 0 || (_comments$ = _comments$.slice(0, 2)) === null || _comments$ === void 0 ? void 0 : _comments$.toUpperCase()) || 'CM';
@@ -131,13 +144,13 @@ var RenderCommentMarkers = function RenderCommentMarkers(props) {
131
144
  key: time
132
145
  }, endPercent !== null && /*#__PURE__*/_react["default"].createElement(MarkerLine, {
133
146
  style: {
134
- left: "".concat(startPercent, "%"),
135
- width: "calc(".concat(endPercent - startPercent, "% )"),
147
+ left: "".concat(safeStart, "%"),
148
+ width: "calc(".concat(safeEnd - safeStart, "% )"),
136
149
  opacity: hovered === time ? 1 : 0
137
150
  }
138
151
  }), /*#__PURE__*/_react["default"].createElement(MarkerDot, {
139
152
  style: {
140
- left: "".concat(startPercent, "%")
153
+ left: "".concat(safeStart, "%")
141
154
  },
142
155
  onMouseEnter: function onMouseEnter() {
143
156
  return setHovered(time);
@@ -151,14 +164,14 @@ var RenderCommentMarkers = function RenderCommentMarkers(props) {
151
164
  }
152
165
  }, displayLabel), endPercent !== null && /*#__PURE__*/_react["default"].createElement(EndMarkerDot, {
153
166
  style: {
154
- left: "".concat(endPercent, "%"),
167
+ left: "".concat(safeEnd, "%"),
155
168
  opacity: hovered === time ? 1 : 0
156
169
  }
157
170
  }), hovered === time && /*#__PURE__*/_react["default"].createElement(HoverBox, {
158
171
  commentLength: comments.length,
159
172
  tabIndex: 0,
160
173
  style: {
161
- '--left': "".concat(getSafeLeft(startPercent), "%")
174
+ '--left': "".concat(getSafeLeft(safeStart), "%") // <-- updated for first/last
162
175
  },
163
176
  onMouseEnter: function onMouseEnter() {
164
177
  if (hideTimer.current) clearTimeout(hideTimer.current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desynova-digital/player",
3
- "version": "4.0.88",
3
+ "version": "4.0.89",
4
4
  "description": "Video Player Package for Contido Application",
5
5
  "main": "index.js",
6
6
  "scripts": {