@desynova-digital/player 4.0.102 → 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
|
@@ -446,6 +446,18 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
446
446
|
this.actions.seek(start_time);
|
|
447
447
|
this.actions.handleVideoPreview(true);
|
|
448
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
|
+
}
|
|
449
461
|
}, {
|
|
450
462
|
key: "getDefaultChildren",
|
|
451
463
|
value: function getDefaultChildren(props, fullProps) {
|
|
@@ -798,8 +810,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
798
810
|
}, {
|
|
799
811
|
key: "handleResize",
|
|
800
812
|
value: function handleResize() {
|
|
801
|
-
var _this$manager$
|
|
802
|
-
player = _this$manager$
|
|
813
|
+
var _this$manager$getStat3 = this.manager.getState(),
|
|
814
|
+
player = _this$manager$getStat3.player;
|
|
803
815
|
var leftSectionRef = this._leftSectionRef;
|
|
804
816
|
var rightSectionRef = this._rightSectionRef;
|
|
805
817
|
var audioMeterBlock = this._audioMeterBlock;
|
|
@@ -962,8 +974,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
962
974
|
}, {
|
|
963
975
|
key: "handleBlur",
|
|
964
976
|
value: function handleBlur() {
|
|
965
|
-
var _this$manager$
|
|
966
|
-
player = _this$manager$
|
|
977
|
+
var _this$manager$getStat4 = this.manager.getState(),
|
|
978
|
+
player = _this$manager$getStat4.player;
|
|
967
979
|
if (player.isFullscreen) return;
|
|
968
980
|
this.actions.activate(false);
|
|
969
981
|
}
|
|
@@ -981,8 +993,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
981
993
|
value: function render() {
|
|
982
994
|
var _this6 = this,
|
|
983
995
|
_props$player;
|
|
984
|
-
var _this$manager$
|
|
985
|
-
player = _this$manager$
|
|
996
|
+
var _this$manager$getStat5 = this.manager.getState(),
|
|
997
|
+
player = _this$manager$getStat5.player;
|
|
986
998
|
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
987
999
|
player: player,
|
|
988
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) {
|