@desynova-digital/player 4.0.88 → 4.0.90

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;
@@ -453,17 +455,17 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
453
455
  key: "control-bar",
454
456
  pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
455
457
  order: 5,
456
- playerType: fullProps.playerType
458
+ playerType: fullProps.playerType,
459
+ onRightMenuVisible: onRightMenuVisible
457
460
  }, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
458
461
  key: "shortcut",
459
- order: 99.0
460
- }, props, {
461
462
  pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
462
463
  playerType: fullProps.playerType,
463
464
  frameRate: fullProps.frameRate,
464
465
  isRightMenuVisible: isRightMenuVisible,
465
- onRightMenuVisible: onRightMenuVisible
466
- }))];
466
+ onRightMenuVisible: onRightMenuVisible,
467
+ order: 99.0
468
+ }, props))];
467
469
  }
468
470
  }, {
469
471
  key: "getImageChildren",
@@ -503,20 +505,21 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
503
505
  key: "getAdvancedChildren",
504
506
  value: function getAdvancedChildren(props, fullProps) {
505
507
  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;
508
+ var _this$props4 = this.props,
509
+ playerSvgRef = _this$props4.playerSvgRef,
510
+ parentAnnotations = _this$props4.parentAnnotations,
511
+ onShapeMouseDown = _this$props4.onShapeMouseDown,
512
+ handleMouseDown = _this$props4.handleMouseDown,
513
+ handleMouseMove = _this$props4.handleMouseMove,
514
+ handleMouseUp = _this$props4.handleMouseUp,
515
+ isSvgLayer = _this$props4.isSvgLayer,
516
+ inTime = _this$props4.inTime,
517
+ outTime = _this$props4.outTime,
518
+ tabMetadata = _this$props4.tabMetadata,
519
+ isRightMenuVisible = _this$props4.isRightMenuVisible,
520
+ isFullscreen = _this$props4.isFullscreen,
521
+ player = _this$props4.player,
522
+ onRightMenuVisible = _this$props4.onRightMenuVisible;
520
523
  return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
521
524
  ref: function ref(c) {
522
525
  _this4._playerHeader = c;
@@ -547,15 +550,17 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
547
550
  key: "control-bar",
548
551
  pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
549
552
  order: 3,
550
- playerType: fullProps.playerType
553
+ playerType: fullProps.playerType,
554
+ onRightMenuVisible: onRightMenuVisible
551
555
  }, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
552
556
  key: "shortcut",
553
- order: 99.0
554
- }, props, {
557
+ pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
555
558
  playerType: fullProps.playerType,
556
559
  frameRate: fullProps.frameRate,
557
- pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect
558
- }))];
560
+ isRightMenuVisible: isRightMenuVisible,
561
+ onRightMenuVisible: onRightMenuVisible,
562
+ order: 99.0
563
+ }, props))];
559
564
  }
560
565
  }, {
561
566
  key: "getChildren",
@@ -713,8 +718,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
713
718
  }, {
714
719
  key: "handleResize",
715
720
  value: function handleResize() {
716
- var _this$manager$getStat = this.manager.getState(),
717
- player = _this$manager$getStat.player;
721
+ var _this$manager$getStat2 = this.manager.getState(),
722
+ player = _this$manager$getStat2.player;
718
723
  var leftSectionRef = this._leftSectionRef;
719
724
  var rightSectionRef = this._rightSectionRef;
720
725
  var audioMeterBlock = this._audioMeterBlock;
@@ -724,14 +729,16 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
724
729
  var controlBar = (0, _reactDom.findDOMNode)(this._controlBar);
725
730
  var playlist = (0, _reactDom.findDOMNode)(this._playlist);
726
731
  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;
732
+ var _this$props5 = this.props,
733
+ controlType = _this$props5.controlType,
734
+ playerType = _this$props5.playerType,
735
+ fileType = _this$props5.fileType,
736
+ isRightMenuVisible = _this$props5.isRightMenuVisible;
732
737
 
733
738
  //added for header height
734
739
  var headerHeight = playerHeader ? playerHeader.offsetHeight : 60;
740
+ var progressControlHeight = controlBar ? controlBar.offsetHeight : 0;
741
+ var controlBarHeight = progressControl ? progressControl.offsetHeight : 0;
735
742
  var totalHeight = window.innerHeight;
736
743
  var totalWidth = window.innerWidth;
737
744
  var newHeight;
@@ -793,7 +800,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
793
800
  availableWidth = totalWidth - rightSectionRef.offsetWidth;
794
801
  }
795
802
  // Calculate video dimensions based on available space
796
- videoHeight = totalHeight - headerHeight - progressControl.offsetHeight - controlBar.offsetHeight;
803
+ videoHeight = totalHeight - headerHeight - progressControlHeight - controlBarHeight;
797
804
  videoWidth = videoHeight * (16 / 9);
798
805
  // If video width exceeds available width, recalculate based on width
799
806
  if (videoWidth > availableWidth) {
@@ -865,14 +872,17 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
865
872
  }, {
866
873
  key: "handleBlur",
867
874
  value: function handleBlur() {
875
+ var _this$manager$getStat3 = this.manager.getState(),
876
+ player = _this$manager$getStat3.player;
877
+ if (player.isFullscreen) return;
868
878
  this.actions.activate(false);
869
879
  }
870
880
  }, {
871
881
  key: "render",
872
882
  value: function render() {
873
883
  var _this5 = this;
874
- var _this$manager$getStat2 = this.manager.getState(),
875
- player = _this$manager$getStat2.player;
884
+ var _this$manager$getStat4 = this.manager.getState(),
885
+ player = _this$manager$getStat4.player;
876
886
  var props = _objectSpread(_objectSpread({}, this.props), {}, {
877
887
  player: player,
878
888
  actions: this.actions,
@@ -881,12 +891,12 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
881
891
  video: this.video ? this.video.video : null
882
892
  });
883
893
  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;
894
+ var _this$props6 = this.props,
895
+ rightSection = _this$props6.rightSection,
896
+ playerType = _this$props6.playerType,
897
+ isFullscreen = _this$props6.isFullscreen,
898
+ tabMetadata = _this$props6.tabMetadata,
899
+ isRightMenuVisible = _this$props6.isRightMenuVisible;
890
900
  return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
891
901
  ref: function ref(c) {
892
902
  _this5.manager.rootElement = c;
@@ -355,7 +355,7 @@ var PlayerHeader = exports["default"] = /*#__PURE__*/function (_Component) {
355
355
  onClick: function onClick() {
356
356
  return _this2.openQCReport();
357
357
  }
358
- }, this.props)), playerType !== 'default' && playerType !== 'clipping_default' ? /*#__PURE__*/_react["default"].createElement(_components.Button, _extends({
358
+ }, this.props)), !isFullscreen && playerType !== 'default' && playerType !== 'clipping_default' ? /*#__PURE__*/_react["default"].createElement(_components.Button, _extends({
359
359
  display: "rounded",
360
360
  appearance: "cta",
361
361
  icon: playerType === 'dubbing_review' ? 'access_dubbing_studio' : playerType,
@@ -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) {
@@ -91,7 +91,12 @@ var MarkInControl = exports["default"] = /*#__PURE__*/function (_Component) {
91
91
  onAddMarker = _this$props2.onAddMarker,
92
92
  frameRate = _this$props2.frameRate,
93
93
  playerType = _this$props2.playerType,
94
- enablePlayerActions = _this$props2.enablePlayerActions;
94
+ enablePlayerActions = _this$props2.enablePlayerActions,
95
+ onRightMenuVisible = _this$props2.onRightMenuVisible;
96
+ if (player.isFullscreen) {
97
+ actions.toggleRightBar(player, true);
98
+ onRightMenuVisible(true);
99
+ }
95
100
  if (["snp_edit", "promo_review", "pgm_edit", "dubbing_review"].includes(playerType) || enablePlayerActions.includes('single_annotation')) {
96
101
  var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
97
102
  var data = {
@@ -98,7 +98,8 @@ var MarkOutControl = exports["default"] = /*#__PURE__*/function (_Component) {
98
98
  onMarkerSelect = _this$props2.onMarkerSelect,
99
99
  onAddMarker = _this$props2.onAddMarker,
100
100
  frameRate = _this$props2.frameRate,
101
- pauseOnOutMarkerSelect = _this$props2.pauseOnOutMarkerSelect;
101
+ pauseOnOutMarkerSelect = _this$props2.pauseOnOutMarkerSelect,
102
+ onRightMenuVisible = _this$props2.onRightMenuVisible;
102
103
  if (leftMarker > -1 && player.currentTime > leftMarker) {
103
104
  // actions.handleMarkerPointChange('add', 'right', player.currentTime);
104
105
  //Commented for CN-632.
@@ -106,6 +107,10 @@ var MarkOutControl = exports["default"] = /*#__PURE__*/function (_Component) {
106
107
  // onMarkerSelect(leftMarker, player.currentTime);
107
108
  // }
108
109
  // actions.handleMarkerPointChange('create');
110
+ if (player.isFullscreen) {
111
+ actions.toggleRightBar(player, true);
112
+ onRightMenuVisible(true);
113
+ }
109
114
  if (pauseOnOutMarkerSelect && !player.paused) {
110
115
  actions.pause({
111
116
  action: 'pause',
@@ -57,7 +57,8 @@ function MarkingControl(_ref) {
57
57
  theme = _ref.theme,
58
58
  enablePlayerActions = _ref.enablePlayerActions,
59
59
  pauseOnOutMarkerSelect = _ref.pauseOnOutMarkerSelect,
60
- timeCodeFormat = _ref.timeCodeFormat;
60
+ timeCodeFormat = _ref.timeCodeFormat,
61
+ onRightMenuVisible = _ref.onRightMenuVisible;
61
62
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, playerType !== 'panel' && playerType !== 'default' && playerType !== 'clipping_default' ? /*#__PURE__*/_react["default"].createElement(MarkingBlock, {
62
63
  theme: theme
63
64
  }, (!((playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.leftMarker) > -1) || !((playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.rightMarker) > -1)) && playerType !== 'panel' && playerType !== 'default' && playerType !== 'clipping_default' && !playerReadOnlyMode && !disablePlayerActions.includes('marking_controls') ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_MarkInControl["default"], {
@@ -69,7 +70,8 @@ function MarkingControl(_ref) {
69
70
  allowMarkerOverlap: allowMarkerOverlap,
70
71
  onAddMarker: onAddMarker,
71
72
  enablePlayerActions: enablePlayerActions,
72
- playerType: playerType
73
+ playerType: playerType,
74
+ onRightMenuVisible: onRightMenuVisible
73
75
  }), /*#__PURE__*/_react["default"].createElement(_MarkOutControl["default"], {
74
76
  theme: theme,
75
77
  leftMarker: playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.leftMarker,
@@ -81,7 +83,8 @@ function MarkingControl(_ref) {
81
83
  onMarkerSelect: onMarkerSelect,
82
84
  allowMarkerOverlap: allowMarkerOverlap,
83
85
  onAddMarker: onAddMarker,
84
- pauseOnOutMarkerSelect: pauseOnOutMarkerSelect
86
+ pauseOnOutMarkerSelect: pauseOnOutMarkerSelect,
87
+ onRightMenuVisible: onRightMenuVisible
85
88
  })) : null, (playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.leftMarker) > -1 || (playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.rightMarker) > -1 ? /*#__PURE__*/_react["default"].createElement(_MarkingDuration["default"], {
86
89
  theme: theme,
87
90
  leftMarker: playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.leftMarker,
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
+ var _components = require("@desynova-digital/components");
10
11
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
11
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -22,67 +23,83 @@ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.fre
22
23
  TIMELINE MAIN WRAPPER
23
24
  ---------------------------------------------------------- */
24
25
  var MarkerTimeline = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 11px;\n"])));
26
+
25
27
  /* ----------------------------------------------------------
26
- MARKER DOT (start dot)
28
+ MARKER DOT
27
29
  ---------------------------------------------------------- */
28
- var MarkerDot = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: -6px;\n transform: translateX(-50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #47d2c7;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #0a0f18;\n font-weight: 600;\n font-size: 10px;\n cursor: pointer;\n z-index: 9000;\n\n &:hover {\n background: #3bbfb6;\n }\n"])));
30
+ var MarkerDot = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: -6px;\n transform: translateX(-50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #47d2c7;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #0a0f18;\n font-weight: 600;\n font-size: 10px;\n cursor: pointer;\n z-index: ", ";\n pointer-events: auto;\n\n /* invisible hit-box (prevents overlap hover loss) */\n &::before {\n content: \"\";\n position: absolute;\n width: 32px;\n height: 32px;\n top: -6px;\n left: -6px;\n }\n\n &:hover {\n background: #3bbfb6;\n }\n"])), function (p) {
31
+ return p.isHovered ? 99999 : 9000;
32
+ });
33
+
29
34
  /* ----------------------------------------------------------
30
- END MARKER DOT (VISIBLE ONLY ON HOVER)
35
+ END MARKER DOT
31
36
  ---------------------------------------------------------- */
32
- var EndMarkerDot = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: -6px;\n transform: translateX(-50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #2ee8dd;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9000;\n opacity: 0;\n transition: opacity 0.15s ease-out;\n cursor: pointer;\n\n &::after {\n content: '';\n width: 10px;\n height: 10px;\n background: white;\n border-radius: 50%;\n }\n"])));
37
+ var EndMarkerDot = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: -6px;\n transform: translateX(-50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #2ee8dd;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9000;\n opacity: 0;\n transition: opacity 0.15s ease-out;\n\n &::after {\n content: '';\n width: 10px;\n height: 10px;\n background: white;\n border-radius: 50%;\n }\n"])));
38
+
33
39
  /* ----------------------------------------------------------
34
- HORIZONTAL SEGMENT LINE
40
+ SEGMENT LINE
35
41
  ---------------------------------------------------------- */
36
- var MarkerLine = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 4px;\n height: 3px;\n background: #47d2c7;\n border-radius: 2px;\n z-index: 8000;\n\n opacity: 0;\n transition: opacity 0.15s ease-out;\n"])));
42
+ var MarkerLine = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 4px;\n height: 3px;\n background: #47d2c7;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 0.15s ease-out;\n"])));
37
43
 
38
44
  /* ----------------------------------------------------------
39
45
  HOVER BOX
40
46
  ---------------------------------------------------------- */
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) {
42
- return props.commentLength > 1 ? '0px 9px 8px 4px' : '10px 9px 8px 4px';
47
+ var HoverBox = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 30px;\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 overflow-y: auto;\n animation: fadeInBox 0.18s ease-out;\n min-width: 150px;\n max-width: 240px;\n max-height: 400px;\n"])), function (p) {
48
+ return p.commentLength > 1 ? "0px 9px 8px 4px" : "10px 9px 8px 4px";
43
49
  });
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
- 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"])));
50
+ 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 padding: 10px 12px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n margin-bottom: 8px;\n"])));
51
+ 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);\n transform: translateX(2px);\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
52
  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
53
  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"])));
54
+ var HoverText = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n font-size: 14px;\n color: #fff;\n line-height: 21px;\n overflow: hidden;\n"])));
49
55
 
50
56
  /* ----------------------------------------------------------
51
- SAFE LEFT POSITION
57
+ UTILITIES (FIXED)
52
58
  ---------------------------------------------------------- */
53
- var getSafeLeft = function getSafeLeft(percent) {
54
- if (percent < 5) return 5;
55
- if (percent > 95) return 95;
56
- return percent;
59
+ var clampPx = function clampPx(px, containerWidth) {
60
+ var SAFE = 10;
61
+ if (px <= SAFE) return SAFE;
62
+ if (px >= containerWidth - SAFE) return containerWidth - SAFE;
63
+ return px;
64
+ };
65
+ var getMarkerPercent = function getMarkerPercent(time, duration, zoom) {
66
+ if (!duration) return 0;
67
+ var pct = time / duration;
68
+ return pct * 100 * (zoom > 0 ? zoom * 20 : 1);
69
+ };
70
+ var getSafeLeftPx = function getSafeLeftPx(percent, containerWidth) {
71
+ if (!containerWidth) return "".concat(percent, "%");
72
+ var px = percent / 100 * containerWidth;
73
+ return "".concat(clampPx(px, containerWidth), "px");
57
74
  };
58
75
 
59
76
  /* ----------------------------------------------------------
60
- TIME PERCENT
77
+ HOVER BOX CLAMP
61
78
  ---------------------------------------------------------- */
62
- var getMarkerPercent = function getMarkerPercent(time, duration, zoom) {
63
- if (!duration || duration <= 0) return 0;
64
- var percent = time / duration;
65
- percent = percent >= 1 ? 1 : percent;
66
- if (zoom > 0) return percent * 100 * zoom * 20;
67
- return percent * 100;
79
+ var clampHoverBoxLeft = function clampHoverBoxLeft(rawLeftPx, boxWidth, containerWidth) {
80
+ var SAFE = 10;
81
+ var max = containerWidth - boxWidth - SAFE;
82
+ return Math.max(SAFE, Math.min(rawLeftPx, max));
68
83
  };
69
84
 
70
85
  /* ----------------------------------------------------------
71
86
  MAIN COMPONENT
72
87
  ---------------------------------------------------------- */
73
- var RenderCommentMarkers = function RenderCommentMarkers(props) {
74
- var _props$data = props.data,
75
- data = _props$data === void 0 ? [] : _props$data,
76
- _props$duration = props.duration,
77
- duration = _props$duration === void 0 ? 100.0 : _props$duration,
78
- _props$zoom = props.zoom,
79
- zoom = _props$zoom === void 0 ? 0 : _props$zoom,
80
- playerType = props.playerType,
81
- onSegmentClick = props.onSegmentClick,
82
- onRightMenuVisible = props.onRightMenuVisible,
83
- actions = props.actions,
84
- player = props.player;
85
- if (!['snp_edit', 'pgm_edit'].includes(playerType)) return null;
88
+ var RenderCommentMarkers = function RenderCommentMarkers(_ref) {
89
+ var _containerRef$current;
90
+ var _ref$data = _ref.data,
91
+ data = _ref$data === void 0 ? [] : _ref$data,
92
+ _ref$duration = _ref.duration,
93
+ duration = _ref$duration === void 0 ? 100 : _ref$duration,
94
+ _ref$zoom = _ref.zoom,
95
+ zoom = _ref$zoom === void 0 ? 0 : _ref$zoom,
96
+ playerType = _ref.playerType,
97
+ onSegmentClick = _ref.onSegmentClick,
98
+ onRightMenuVisible = _ref.onRightMenuVisible,
99
+ actions = _ref.actions,
100
+ player = _ref.player,
101
+ frameRate = _ref.frameRate;
102
+ if (!["snp_edit", "pgm_edit"].includes(playerType)) return null;
86
103
  var _useState = (0, _react.useState)(null),
87
104
  _useState2 = _slicedToArray(_useState, 2),
88
105
  hovered = _useState2[0],
@@ -91,77 +108,80 @@ var RenderCommentMarkers = function RenderCommentMarkers(props) {
91
108
  _useState4 = _slicedToArray(_useState3, 2),
92
109
  hoverBoxHold = _useState4[0],
93
110
  setHoverBoxHold = _useState4[1];
94
- var _useState5 = (0, _react.useState)(null),
95
- _useState6 = _slicedToArray(_useState5, 2),
96
- selectedComment = _useState6[0],
97
- setSelectedComment = _useState6[1];
111
+ var containerRef = (0, _react.useRef)(null);
98
112
  var hideTimer = (0, _react.useRef)(null);
99
113
  var startHideTimer = function startHideTimer() {
100
- if (hideTimer.current) clearTimeout(hideTimer.current);
114
+ clearTimeout(hideTimer.current);
101
115
  hideTimer.current = setTimeout(function () {
102
116
  setHoverBoxHold(false);
103
117
  setHovered(null);
104
- setSelectedComment(null);
105
- }, 2000);
106
- };
107
- var handleLeaveMarker = function handleLeaveMarker() {
108
- if (!hoverBoxHold) startHideTimer();
118
+ }, 1500);
109
119
  };
110
- if (!Array.isArray(data) || data.length === 0) return null;
120
+ if (!data.length) return null;
111
121
  var grouped = data.reduce(function (acc, item) {
112
122
  var key = item.value.in_time;
113
- if (!acc[key]) acc[key] = [];
114
- acc[key].push(item);
123
+ (acc[key] = acc[key] || []).push(item);
115
124
  return acc;
116
125
  }, {});
117
- return /*#__PURE__*/_react["default"].createElement(MarkerTimeline, null, Object.entries(grouped).map(function (_ref) {
126
+ var containerWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
127
+ return /*#__PURE__*/_react["default"].createElement(MarkerTimeline, {
128
+ ref: containerRef
129
+ }, Object.entries(grouped).map(function (_ref2) {
118
130
  var _comments$;
119
- var _ref2 = _slicedToArray(_ref, 2),
120
- time = _ref2[0],
121
- comments = _ref2[1];
131
+ var _ref3 = _slicedToArray(_ref2, 2),
132
+ time = _ref3[0],
133
+ comments = _ref3[1];
122
134
  var start = comments[0].value.in_time;
123
135
  var end = comments[0].value.out_time;
124
- var startPercent = getMarkerPercent(start, duration, zoom);
125
- var endPercent = end ? getMarkerPercent(end, duration, zoom) : null;
126
- 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) {
136
+ var startPct = getMarkerPercent(start, duration, zoom);
137
+ var endPct = end ? getMarkerPercent(end, duration, zoom) : null;
138
+ var safeStart = getSafeLeftPx(startPct, containerWidth);
139
+ var safeEnd = endPct !== null ? getSafeLeftPx(endPct, containerWidth) : null;
140
+ 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
141
  return n[0];
128
- })) === 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';
129
- var displayLabel = comments.length > 1 ? comments.length : initials;
142
+ })) === 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";
143
+ var label = comments.length > 1 ? comments.length : initials;
144
+ var isHovered = hovered === time;
130
145
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
131
146
  key: time
132
- }, endPercent !== null && /*#__PURE__*/_react["default"].createElement(MarkerLine, {
147
+ }, endPct !== null && /*#__PURE__*/_react["default"].createElement(MarkerLine, {
133
148
  style: {
134
- left: "".concat(startPercent, "%"),
135
- width: "calc(".concat(endPercent - startPercent, "% )"),
136
- opacity: hovered === time ? 1 : 0
149
+ left: safeStart,
150
+ width: "calc(".concat(endPct - startPct, "% )"),
151
+ opacity: isHovered ? 1 : 0
137
152
  }
138
153
  }), /*#__PURE__*/_react["default"].createElement(MarkerDot, {
139
154
  style: {
140
- left: "".concat(startPercent, "%")
155
+ left: safeStart
141
156
  },
157
+ isHovered: isHovered,
142
158
  onMouseEnter: function onMouseEnter() {
143
159
  return setHovered(time);
144
160
  },
145
- onMouseLeave: handleLeaveMarker,
161
+ onMouseLeave: function onMouseLeave() {
162
+ return !hoverBoxHold && startHideTimer();
163
+ },
146
164
  onClick: function onClick(e) {
147
165
  e.stopPropagation();
148
166
  setHoverBoxHold(true);
149
167
  setHovered(time);
150
- setSelectedComment(comments);
151
168
  }
152
- }, displayLabel), endPercent !== null && /*#__PURE__*/_react["default"].createElement(EndMarkerDot, {
169
+ }, label), endPct !== null && /*#__PURE__*/_react["default"].createElement(EndMarkerDot, {
153
170
  style: {
154
- left: "".concat(endPercent, "%"),
155
- opacity: hovered === time ? 1 : 0
171
+ left: safeEnd,
172
+ opacity: isHovered ? 1 : 0
156
173
  }
157
- }), hovered === time && /*#__PURE__*/_react["default"].createElement(HoverBox, {
174
+ }), isHovered && /*#__PURE__*/_react["default"].createElement(HoverBox, {
158
175
  commentLength: comments.length,
159
- tabIndex: 0,
160
- style: {
161
- '--left': "".concat(getSafeLeft(startPercent), "%")
176
+ ref: function ref(el) {
177
+ if (el && containerWidth) {
178
+ var rawPx = parseFloat(safeStart);
179
+ var clamped = clampHoverBoxLeft(rawPx, el.offsetWidth, containerWidth);
180
+ el.style.left = "".concat(clamped, "px");
181
+ }
162
182
  },
163
183
  onMouseEnter: function onMouseEnter() {
164
- if (hideTimer.current) clearTimeout(hideTimer.current);
184
+ clearTimeout(hideTimer.current);
165
185
  setHoverBoxHold(true);
166
186
  },
167
187
  onMouseLeave: function onMouseLeave() {
@@ -170,16 +190,24 @@ var RenderCommentMarkers = function RenderCommentMarkers(props) {
170
190
  }
171
191
  }, comments.length > 1 && /*#__PURE__*/_react["default"].createElement(HoverHeader, null, comments.length, " COMMENTS"), comments.map(function (c) {
172
192
  var _c$value$created_by;
193
+ var selectedFormat = localStorage.getItem("timeCodeFormat");
173
194
  return /*#__PURE__*/_react["default"].createElement(HoverComment, {
174
195
  key: c.id,
175
196
  onClick: function onClick(e) {
176
197
  e.stopPropagation();
177
- setSelectedComment(c);
178
198
  onSegmentClick(c.value.in_time, c.value.out_time, false);
179
199
  onRightMenuVisible(true);
180
200
  actions.toggleRightBar(player, true);
181
201
  }
182
- }, /*#__PURE__*/_react["default"].createElement(HoverName, null, (_c$value$created_by = c.value.created_by) === null || _c$value$created_by === void 0 || (_c$value$created_by = _c$value$created_by.name) === null || _c$value$created_by === void 0 ? void 0 : _c$value$created_by.toUpperCase()), /*#__PURE__*/_react["default"].createElement(HoverTime, null, c.value.in_timecode, c.value.out_timecode ? " - ".concat(c.value.out_timecode) : ''), /*#__PURE__*/_react["default"].createElement(HoverText, null, c.value.remark || c.value.sub_title || c.value.title || '—'));
202
+ }, /*#__PURE__*/_react["default"].createElement(HoverName, null, (_c$value$created_by = c.value.created_by) === null || _c$value$created_by === void 0 || (_c$value$created_by = _c$value$created_by.name) === null || _c$value$created_by === void 0 ? void 0 : _c$value$created_by.toUpperCase()), /*#__PURE__*/_react["default"].createElement(HoverTime, null, /*#__PURE__*/_react["default"].createElement(_components.TimeCodeDisplay, {
203
+ timecode: c.value.in_timecode,
204
+ selectedTimecodeFormat: selectedFormat,
205
+ fps: frameRate
206
+ }), c.value.out_timecode && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, " - ", /*#__PURE__*/_react["default"].createElement(_components.TimeCodeDisplay, {
207
+ timecode: c.value.out_timecode,
208
+ selectedTimecodeFormat: selectedFormat,
209
+ fps: frameRate
210
+ }))), /*#__PURE__*/_react["default"].createElement(HoverText, null, c.value.remark || c.value.sub_title || c.value.title || "—"));
183
211
  })));
184
212
  }));
185
213
  };
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.90",
4
4
  "description": "Video Player Package for Contido Application",
5
5
  "main": "index.js",
6
6
  "scripts": {