@desynova-digital/player 4.0.101 → 4.0.103
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/components/Player.js
CHANGED
|
@@ -231,6 +231,12 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
231
231
|
onRightMenuVisible(false);
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
|
+
_defineProperty(_this, "getReviewTabIndex", function () {
|
|
235
|
+
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
236
|
+
_this.setState({
|
|
237
|
+
reviewIndex: index
|
|
238
|
+
});
|
|
239
|
+
});
|
|
234
240
|
// handleFullScreenChange() {
|
|
235
241
|
// this.actions.handleFullscreenChange(fullscreen.isFullscreen);
|
|
236
242
|
// }
|
|
@@ -269,6 +275,9 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
269
275
|
}
|
|
270
276
|
}
|
|
271
277
|
});
|
|
278
|
+
_this.state = {
|
|
279
|
+
reviewIndex: 0
|
|
280
|
+
};
|
|
272
281
|
_this.controlsHideTimer = null;
|
|
273
282
|
_this.meterHeight = 40;
|
|
274
283
|
_this.video = null; // the Video component
|
|
@@ -437,6 +446,18 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
437
446
|
this.actions.seek(start_time);
|
|
438
447
|
this.actions.handleVideoPreview(true);
|
|
439
448
|
}
|
|
449
|
+
}, {
|
|
450
|
+
key: "exitFullScreenMode",
|
|
451
|
+
value: function exitFullScreenMode() {
|
|
452
|
+
var _this$manager$getStat2 = this.manager.getState(),
|
|
453
|
+
player = _this$manager$getStat2.player;
|
|
454
|
+
var onRightMenuVisible = this.props.onRightMenuVisible;
|
|
455
|
+
this.actions.toggleFullscreen(player);
|
|
456
|
+
// Trigger UI change based for exit
|
|
457
|
+
var isFull = player === null || player === void 0 ? void 0 : player.isFullscreen;
|
|
458
|
+
onRightMenuVisible(isFull);
|
|
459
|
+
this.actions.toggleRightBar(player, isFull);
|
|
460
|
+
}
|
|
440
461
|
}, {
|
|
441
462
|
key: "getDefaultChildren",
|
|
442
463
|
value: function getDefaultChildren(props, fullProps) {
|
|
@@ -459,6 +480,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
459
480
|
tabMetadata = _this$props3.tabMetadata,
|
|
460
481
|
player = _this$props3.player,
|
|
461
482
|
onRightMenuVisible = _this$props3.onRightMenuVisible;
|
|
483
|
+
var reviewIndex = this.state.reviewIndex;
|
|
462
484
|
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
463
485
|
ref: function ref(c) {
|
|
464
486
|
_this2._playerHeader = c;
|
|
@@ -503,7 +525,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
503
525
|
onRightMenuVisible: onRightMenuVisible,
|
|
504
526
|
actions: fullProps === null || fullProps === void 0 ? void 0 : fullProps.actions,
|
|
505
527
|
order: 4,
|
|
506
|
-
data: tabMetadata === null || tabMetadata === void 0 || (_tabMetadata$edit_dat = tabMetadata.edit_data) === null || _tabMetadata$edit_dat === void 0 || (_tabMetadata$edit_dat = _tabMetadata$edit_dat[
|
|
528
|
+
data: tabMetadata === null || tabMetadata === void 0 || (_tabMetadata$edit_dat = tabMetadata.edit_data) === null || _tabMetadata$edit_dat === void 0 || (_tabMetadata$edit_dat = _tabMetadata$edit_dat[reviewIndex]) === null || _tabMetadata$edit_dat === void 0 || (_tabMetadata$edit_dat = _tabMetadata$edit_dat.value) === null || _tabMetadata$edit_dat === void 0 ? void 0 : _tabMetadata$edit_dat.map(function (item) {
|
|
507
529
|
var _item$marker_data;
|
|
508
530
|
var itemObj = _objectSpread(_objectSpread({}, item.marker_data), {}, {
|
|
509
531
|
comment_type: item === null || item === void 0 ? void 0 : item.comment_type,
|
|
@@ -788,8 +810,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
788
810
|
}, {
|
|
789
811
|
key: "handleResize",
|
|
790
812
|
value: function handleResize() {
|
|
791
|
-
var _this$manager$
|
|
792
|
-
player = _this$manager$
|
|
813
|
+
var _this$manager$getStat3 = this.manager.getState(),
|
|
814
|
+
player = _this$manager$getStat3.player;
|
|
793
815
|
var leftSectionRef = this._leftSectionRef;
|
|
794
816
|
var rightSectionRef = this._rightSectionRef;
|
|
795
817
|
var audioMeterBlock = this._audioMeterBlock;
|
|
@@ -952,8 +974,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
952
974
|
}, {
|
|
953
975
|
key: "handleBlur",
|
|
954
976
|
value: function handleBlur() {
|
|
955
|
-
var _this$manager$
|
|
956
|
-
player = _this$manager$
|
|
977
|
+
var _this$manager$getStat4 = this.manager.getState(),
|
|
978
|
+
player = _this$manager$getStat4.player;
|
|
957
979
|
if (player.isFullscreen) return;
|
|
958
980
|
this.actions.activate(false);
|
|
959
981
|
}
|
|
@@ -971,8 +993,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
971
993
|
value: function render() {
|
|
972
994
|
var _this6 = this,
|
|
973
995
|
_props$player;
|
|
974
|
-
var _this$manager$
|
|
975
|
-
player = _this$manager$
|
|
996
|
+
var _this$manager$getStat5 = this.manager.getState(),
|
|
997
|
+
player = _this$manager$getStat5.player;
|
|
976
998
|
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
977
999
|
player: player,
|
|
978
1000
|
actions: this.actions,
|
package/components/Video.js
CHANGED
|
@@ -1463,7 +1463,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1463
1463
|
width: '100%',
|
|
1464
1464
|
height: '100%',
|
|
1465
1465
|
pointerEvents: this.state.shouldShowAnnotate ? 'auto' : 'none',
|
|
1466
|
-
zIndex:
|
|
1466
|
+
zIndex: 1
|
|
1467
1467
|
}
|
|
1468
1468
|
}, ((_this$props$parentAnn2 = this.props.parentAnnotations) === null || _this$props$parentAnn2 === void 0 ? void 0 : _this$props$parentAnn2.length) && ((_this$props$parentAnn3 = this.props.parentAnnotations) === null || _this$props$parentAnn3 === void 0 ? void 0 : _this$props$parentAnn3.map(function (ann, idx) {
|
|
1469
1469
|
var _this6$props$playerSv;
|
|
@@ -89,7 +89,6 @@ var clampHoverBoxLeft = function clampHoverBoxLeft(rawLeftPx, boxWidth, containe
|
|
|
89
89
|
MAIN COMPONENT
|
|
90
90
|
---------------------------------------------------------- */
|
|
91
91
|
var RenderCommentMarkers = function RenderCommentMarkers(_ref) {
|
|
92
|
-
var _containerRef$current;
|
|
93
92
|
var _ref$data = _ref.data,
|
|
94
93
|
data = _ref$data === void 0 ? [] : _ref$data,
|
|
95
94
|
_ref$duration = _ref.duration,
|
|
@@ -118,6 +117,53 @@ var RenderCommentMarkers = function RenderCommentMarkers(_ref) {
|
|
|
118
117
|
var isLineVisible = function isLineVisible(time) {
|
|
119
118
|
return hovered === time || hoverBoxHold && hovered === time;
|
|
120
119
|
};
|
|
120
|
+
var _useState5 = (0, _react.useState)(0),
|
|
121
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
122
|
+
containerWidth = _useState6[0],
|
|
123
|
+
setContainerWidth = _useState6[1];
|
|
124
|
+
|
|
125
|
+
// Measure eagerly during layout to avoid first-paint misalignment.
|
|
126
|
+
(0, _react.useLayoutEffect)(function () {
|
|
127
|
+
var measure = function measure() {
|
|
128
|
+
var _containerRef$current;
|
|
129
|
+
return setContainerWidth(((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth) || 0);
|
|
130
|
+
};
|
|
131
|
+
measure();
|
|
132
|
+
// double rAF to catch layout after fullscreen/right-panel changes
|
|
133
|
+
requestAnimationFrame(function () {
|
|
134
|
+
return requestAnimationFrame(measure);
|
|
135
|
+
});
|
|
136
|
+
}, []);
|
|
137
|
+
|
|
138
|
+
// Keep width in sync on first render, fullscreen toggle, right-menu visibility, and resize.
|
|
139
|
+
(0, _react.useEffect)(function () {
|
|
140
|
+
var updateWidth = function updateWidth() {
|
|
141
|
+
var _containerRef$current2;
|
|
142
|
+
return setContainerWidth(((_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.offsetWidth) || 0);
|
|
143
|
+
};
|
|
144
|
+
updateWidth();
|
|
145
|
+
requestAnimationFrame(updateWidth);
|
|
146
|
+
var onResize = function onResize() {
|
|
147
|
+
return updateWidth();
|
|
148
|
+
};
|
|
149
|
+
window.addEventListener('resize', onResize);
|
|
150
|
+
return function () {
|
|
151
|
+
return window.removeEventListener('resize', onResize);
|
|
152
|
+
};
|
|
153
|
+
}, [isRightMenuVisible, player === null || player === void 0 ? void 0 : player.isFullscreen]);
|
|
154
|
+
|
|
155
|
+
// Observe container size for layout shifts.
|
|
156
|
+
(0, _react.useEffect)(function () {
|
|
157
|
+
if (!containerRef.current || typeof ResizeObserver === 'undefined') return;
|
|
158
|
+
var observer = new ResizeObserver(function () {
|
|
159
|
+
var _containerRef$current3;
|
|
160
|
+
return setContainerWidth(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.offsetWidth) || 0);
|
|
161
|
+
});
|
|
162
|
+
observer.observe(containerRef.current);
|
|
163
|
+
return function () {
|
|
164
|
+
return observer.disconnect();
|
|
165
|
+
};
|
|
166
|
+
}, [containerRef.current]);
|
|
121
167
|
var handleMouseEnter = function handleMouseEnter(time) {
|
|
122
168
|
clearTimeout(hideTimer.current);
|
|
123
169
|
setHovered(time);
|
|
@@ -147,7 +193,6 @@ var RenderCommentMarkers = function RenderCommentMarkers(_ref) {
|
|
|
147
193
|
data.forEach(function (item, i) {
|
|
148
194
|
originalIndexMap.set(item.id, i);
|
|
149
195
|
});
|
|
150
|
-
var containerWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
|
|
151
196
|
return /*#__PURE__*/_react["default"].createElement(MarkerTimeline, {
|
|
152
197
|
ref: containerRef
|
|
153
198
|
}, Object.entries(grouped).map(function (_ref2) {
|