@desynova-digital/player 4.0.104 → 4.0.106
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/Playlist.js
CHANGED
|
@@ -85,7 +85,7 @@ var Playlist = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
85
85
|
}
|
|
86
86
|
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
87
87
|
className: "asset-filename"
|
|
88
|
-
}, asset.
|
|
88
|
+
}, asset.asset_name || asset.filename));
|
|
89
89
|
})) : null);
|
|
90
90
|
}
|
|
91
91
|
}]);
|
|
@@ -15,7 +15,7 @@ var _PointersBar = _interopRequireDefault(require("../PointersBar"));
|
|
|
15
15
|
var _colors = _interopRequireDefault(require("../../colors"));
|
|
16
16
|
var _player = _interopRequireDefault(require("../../reducers/player"));
|
|
17
17
|
var _MarkerBar = _interopRequireDefault(require("../MarkerBar"));
|
|
18
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
19
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
20
|
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); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -71,12 +71,53 @@ var ScrollStyledDiv = _styledComponents["default"].div(_templateObject4 || (_tem
|
|
|
71
71
|
return markers.length > 3 ? 'hidden' : 'visible';
|
|
72
72
|
});
|
|
73
73
|
var CoverDiv = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: black;\n z-index: 2;\n position: absolute;\n height: 60px;\n width: 89px;\n left: 0px;\n top: 20px;\n"])));
|
|
74
|
+
var HoverPreviewBox = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: fixed; \n top: 0;\n left: 0;\n width: 220px;\n height: 126px;\n overflow: hidden;\n display: none;\n pointer-events: none;\n z-index: 999999999; \n border: 2px solid #333333;\n border-radius: 4px;\n"])));
|
|
75
|
+
var HoverPreviewImage = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n width: 220px;\n height: auto;\n"])));
|
|
74
76
|
var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
75
77
|
function ProgressControl(props, context) {
|
|
76
78
|
var _props$player$zoom, _props$player;
|
|
77
79
|
var _this;
|
|
78
80
|
_classCallCheck(this, ProgressControl);
|
|
79
81
|
_this = _callSuper(this, ProgressControl, [props, context]);
|
|
82
|
+
_defineProperty(_this, "handleHoverScrub", function (event) {
|
|
83
|
+
var _this$props;
|
|
84
|
+
var hoverBox = _this.hoverBoxRef.current;
|
|
85
|
+
var hoverImg = _this.hoverImageRef.current;
|
|
86
|
+
if (!hoverBox || !hoverImg) return;
|
|
87
|
+
var container = event.currentTarget;
|
|
88
|
+
var rect = container.getBoundingClientRect();
|
|
89
|
+
var scrollLeft = container.scrollLeft || 0;
|
|
90
|
+
var offsetX = event.clientX - rect.left + scrollLeft;
|
|
91
|
+
offsetX = Math.max(0, Math.min(offsetX, container.scrollWidth));
|
|
92
|
+
var previewBlockHeight = 126;
|
|
93
|
+
var iframeOgHeight = 120;
|
|
94
|
+
var ogHeight = hoverImg.naturalHeight || 1;
|
|
95
|
+
var offsetHeight = hoverImg.offsetHeight || 1;
|
|
96
|
+
var frameCount = Math.max(1, Math.floor(ogHeight / iframeOgHeight));
|
|
97
|
+
var frameHeight = offsetHeight / frameCount;
|
|
98
|
+
var offsetTop = Math.abs(previewBlockHeight - frameHeight) / 2;
|
|
99
|
+
var frameNum = Math.floor(offsetX / container.scrollWidth * frameCount);
|
|
100
|
+
frameNum = Math.max(0, Math.min(frameNum, frameCount - 1));
|
|
101
|
+
hoverImg.style.top = "-".concat(frameHeight * frameNum + offsetTop, "px");
|
|
102
|
+
var hoverWidth = hoverBox.offsetWidth || 220;
|
|
103
|
+
var boxLeft = event.clientX - hoverWidth / 2;
|
|
104
|
+
var padding = 10;
|
|
105
|
+
var minLeft = rect.left + padding;
|
|
106
|
+
var maxLeft = rect.right - hoverWidth - padding;
|
|
107
|
+
boxLeft = Math.max(minLeft, Math.min(boxLeft, maxLeft));
|
|
108
|
+
hoverBox.style.left = "".concat(boxLeft, "px");
|
|
109
|
+
hoverBox.style.top = ((_this$props = _this.props) === null || _this$props === void 0 ? void 0 : _this$props.controlType) == 'default' ? "".concat(rect.top - hoverBox.offsetHeight - 10, "px") : "".concat(rect.top - hoverBox.offsetHeight + 10, "px");
|
|
110
|
+
});
|
|
111
|
+
_defineProperty(_this, "showHoverPreview", function () {
|
|
112
|
+
if (_this.hoverBoxRef.current) {
|
|
113
|
+
_this.hoverBoxRef.current.style.display = 'block';
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
_defineProperty(_this, "hideHoverPreview", function () {
|
|
117
|
+
if (_this.hoverBoxRef.current) {
|
|
118
|
+
_this.hoverBoxRef.current.style.display = 'none';
|
|
119
|
+
}
|
|
120
|
+
});
|
|
80
121
|
_defineProperty(_this, "handleChildScroll", function (scrollTop) {
|
|
81
122
|
if (_this.parentScrollDivRef.current) {
|
|
82
123
|
_this.parentScrollDivRef.current.scrollTop = scrollTop;
|
|
@@ -90,6 +131,8 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
90
131
|
}
|
|
91
132
|
};
|
|
92
133
|
_this.parentScrollDivRef = /*#__PURE__*/(0, _react.createRef)();
|
|
134
|
+
_this.hoverBoxRef = /*#__PURE__*/(0, _react.createRef)();
|
|
135
|
+
_this.hoverImageRef = /*#__PURE__*/(0, _react.createRef)();
|
|
93
136
|
_this.handleMouseMoveThrottle = _this.handleMouseMove.bind(_this);
|
|
94
137
|
_this.handleSeekbarZoom = _this.handleSeekbarZoom.bind(_this);
|
|
95
138
|
_this.ensureInitialSizing = _this.ensureInitialSizing.bind(_this);
|
|
@@ -106,13 +149,13 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
106
149
|
}, {
|
|
107
150
|
key: "componentDidUpdate",
|
|
108
151
|
value: function componentDidUpdate() {
|
|
109
|
-
var _this$
|
|
110
|
-
_this$
|
|
111
|
-
zoom = _this$
|
|
112
|
-
readyState = _this$
|
|
113
|
-
isFullscreen = _this$
|
|
114
|
-
duration = _this$
|
|
115
|
-
controlType = _this$
|
|
152
|
+
var _this$props2 = this.props,
|
|
153
|
+
_this$props2$player = _this$props2.player,
|
|
154
|
+
zoom = _this$props2$player.zoom,
|
|
155
|
+
readyState = _this$props2$player.readyState,
|
|
156
|
+
isFullscreen = _this$props2$player.isFullscreen,
|
|
157
|
+
duration = _this$props2$player.duration,
|
|
158
|
+
controlType = _this$props2.controlType;
|
|
116
159
|
var prevDuration = this.prevDuration;
|
|
117
160
|
this.prevDuration = duration;
|
|
118
161
|
var stateZoom = this.state.stateZoom;
|
|
@@ -132,9 +175,9 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
132
175
|
key: "handleSeekbarZoom",
|
|
133
176
|
value: function handleSeekbarZoom() {
|
|
134
177
|
var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
135
|
-
var _this$props$
|
|
136
|
-
zoom = _this$props$
|
|
137
|
-
readyState = _this$props$
|
|
178
|
+
var _this$props$player = this.props.player,
|
|
179
|
+
zoom = _this$props$player.zoom,
|
|
180
|
+
readyState = _this$props$player.readyState;
|
|
138
181
|
if (!force && readyState !== 4) {
|
|
139
182
|
return;
|
|
140
183
|
}
|
|
@@ -156,9 +199,9 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
156
199
|
key: "ensureInitialSizing",
|
|
157
200
|
value: function ensureInitialSizing() {
|
|
158
201
|
var _this2 = this;
|
|
159
|
-
var _this$props$
|
|
160
|
-
zoom = _this$props$
|
|
161
|
-
duration = _this$props$
|
|
202
|
+
var _this$props$player2 = this.props.player,
|
|
203
|
+
zoom = _this$props$player2.zoom,
|
|
204
|
+
duration = _this$props$player2.duration;
|
|
162
205
|
if (!duration) return;
|
|
163
206
|
// First attempt on next paint
|
|
164
207
|
requestAnimationFrame(function () {
|
|
@@ -177,9 +220,9 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
177
220
|
_this$seekBar2,
|
|
178
221
|
_this3 = this;
|
|
179
222
|
var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
180
|
-
var _this$props$
|
|
181
|
-
zoom = _this$props$
|
|
182
|
-
duration = _this$props$
|
|
223
|
+
var _this$props$player3 = this.props.player,
|
|
224
|
+
zoom = _this$props$player3.zoom,
|
|
225
|
+
duration = _this$props$player3.duration;
|
|
183
226
|
if (!duration) return;
|
|
184
227
|
var currentZoom = parseFloat((zoom || 0).toFixed(1));
|
|
185
228
|
if ((_this$seekBar = this.seekBar) !== null && _this$seekBar !== void 0 && _this$seekBar.timeline) {
|
|
@@ -222,16 +265,16 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
222
265
|
key: "render",
|
|
223
266
|
value: function render() {
|
|
224
267
|
var _this4 = this;
|
|
225
|
-
var _this$
|
|
226
|
-
controlType = _this$
|
|
227
|
-
playerType = _this$
|
|
228
|
-
_this$
|
|
229
|
-
userActivity = _this$
|
|
230
|
-
isFullscreen = _this$
|
|
231
|
-
duration = _this$
|
|
232
|
-
markers = _this$
|
|
233
|
-
theme = _this$
|
|
234
|
-
zoom = _this$
|
|
268
|
+
var _this$props3 = this.props,
|
|
269
|
+
controlType = _this$props3.controlType,
|
|
270
|
+
playerType = _this$props3.playerType,
|
|
271
|
+
_this$props3$player = _this$props3.player,
|
|
272
|
+
userActivity = _this$props3$player.userActivity,
|
|
273
|
+
isFullscreen = _this$props3$player.isFullscreen,
|
|
274
|
+
duration = _this$props3$player.duration,
|
|
275
|
+
markers = _this$props3.markers,
|
|
276
|
+
theme = _this$props3.theme,
|
|
277
|
+
zoom = _this$props3.zoom;
|
|
235
278
|
var _this$state = this.state,
|
|
236
279
|
mouseTime = _this$state.mouseTime,
|
|
237
280
|
stateZoom = _this$state.stateZoom;
|
|
@@ -268,7 +311,10 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
268
311
|
onMouseMove: this.handleMouseMoveThrottle,
|
|
269
312
|
isFullscreen: isFullscreen
|
|
270
313
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
271
|
-
className: "timeline-content hide-scrollbar"
|
|
314
|
+
className: "timeline-content hide-scrollbar",
|
|
315
|
+
onMouseMove: this.handleHoverScrub,
|
|
316
|
+
onMouseEnter: this.showHoverPreview,
|
|
317
|
+
onMouseLeave: this.hideHoverPreview
|
|
272
318
|
}, /*#__PURE__*/_react["default"].createElement(_SeekBar["default"], _extends({
|
|
273
319
|
mouseTime: mouseTime,
|
|
274
320
|
ref: function ref(c) {
|
|
@@ -284,7 +330,13 @@ var ProgressControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
284
330
|
_this4.pointersBar = c;
|
|
285
331
|
},
|
|
286
332
|
zoom: stateZoom && parseFloat(stateZoom.toFixed(1))
|
|
287
|
-
}, this.props))))
|
|
333
|
+
}, this.props)))), this.props.iframeURL && /*#__PURE__*/_react["default"].createElement(HoverPreviewBox, {
|
|
334
|
+
ref: this.hoverBoxRef
|
|
335
|
+
}, /*#__PURE__*/_react["default"].createElement(HoverPreviewImage, {
|
|
336
|
+
ref: this.hoverImageRef,
|
|
337
|
+
src: this.props.iframeURL,
|
|
338
|
+
draggable: false
|
|
339
|
+
}))), controlType === 'advanced' && !isFullscreen ? /*#__PURE__*/_react["default"].createElement(MarkerTagsBlock, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
288
340
|
className: "empty-block"
|
|
289
341
|
})) : null));
|
|
290
342
|
}
|
|
@@ -347,18 +347,12 @@ var SeekBar = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
347
347
|
onMouseDown: this.handleMouseDown,
|
|
348
348
|
onMouseMove: function onMouseMove(e) {
|
|
349
349
|
_this4.handleMouseMove(e); // existing seeking
|
|
350
|
-
|
|
350
|
+
// this.handleHoverScrub(e); // NEW preview scrub
|
|
351
351
|
},
|
|
352
352
|
onMouseUp: this.handleMouseUp,
|
|
353
353
|
onMouseEnter: this.showHoverPreview,
|
|
354
354
|
onMouseLeave: this.hideHoverPreview
|
|
355
|
-
},
|
|
356
|
-
ref: this.hoverBoxRef
|
|
357
|
-
}, /*#__PURE__*/_react["default"].createElement(HoverPreviewImage, {
|
|
358
|
-
ref: this.hoverImageRef,
|
|
359
|
-
src: this.props.iframeURL,
|
|
360
|
-
draggable: false
|
|
361
|
-
})), /*#__PURE__*/_react["default"].createElement(SliderBlock, {
|
|
355
|
+
}, /*#__PURE__*/_react["default"].createElement(SliderBlock, {
|
|
362
356
|
playerType: playerType,
|
|
363
357
|
isFullscreen: isFullscreen
|
|
364
358
|
}, /*#__PURE__*/_react["default"].createElement(_Slider["default"], _extends({}, this.props, {
|