@desynova-digital/player 4.0.34 → 4.0.36
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 +19 -16
- package/components/Shortcut.js +90 -92
- package/components/Video.js +1 -1
- package/package.json +1 -1
package/components/Player.js
CHANGED
|
@@ -214,7 +214,10 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
214
214
|
return _createClass(Player, [{
|
|
215
215
|
key: "handleMarginsAndGrid",
|
|
216
216
|
value: function handleMarginsAndGrid() {
|
|
217
|
-
|
|
217
|
+
var _this$props = this.props,
|
|
218
|
+
quality = _this$props.quality,
|
|
219
|
+
playerType = _this$props.playerType;
|
|
220
|
+
if (["snp_edit", "promo_review", "pgm_edit", "dubbing_review"].includes(playerType)) {
|
|
218
221
|
this.actions.handleSDBorderChange({
|
|
219
222
|
key: "fourThreeSafeArea",
|
|
220
223
|
value: false
|
|
@@ -231,8 +234,8 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
231
234
|
key: "sixteenNineSafeArea",
|
|
232
235
|
value: false
|
|
233
236
|
});
|
|
234
|
-
} else if (
|
|
235
|
-
if (
|
|
237
|
+
} else if (playerType === 'qc') {
|
|
238
|
+
if (quality === 'hd' || quality === 'uhd') {
|
|
236
239
|
this.actions.handleSDBorderChange({
|
|
237
240
|
key: "fourThreeSafeArea",
|
|
238
241
|
value: false
|
|
@@ -249,7 +252,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
249
252
|
key: "HDBorderActive",
|
|
250
253
|
value: true
|
|
251
254
|
});
|
|
252
|
-
} else if (
|
|
255
|
+
} else if (quality === 'sd') {
|
|
253
256
|
this.actions.handleSDBorderChange({
|
|
254
257
|
key: "HDBorderActive",
|
|
255
258
|
value: false
|
|
@@ -276,12 +279,12 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
276
279
|
key: "sixteenNineSafeArea",
|
|
277
280
|
value: false
|
|
278
281
|
});
|
|
279
|
-
if (
|
|
282
|
+
if (quality === 'hd' || quality === 'uhd') {
|
|
280
283
|
this.actions.handleSDBorderChange({
|
|
281
284
|
key: "SDBorderActive",
|
|
282
285
|
value: false
|
|
283
286
|
});
|
|
284
|
-
} else if (
|
|
287
|
+
} else if (quality === 'sd') {
|
|
285
288
|
this.actions.handleSDBorderChange({
|
|
286
289
|
key: "HDBorderActive",
|
|
287
290
|
value: false
|
|
@@ -304,9 +307,9 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
304
307
|
}, {
|
|
305
308
|
key: "componentDidUpdate",
|
|
306
309
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
307
|
-
var _this$
|
|
308
|
-
playerType = _this$
|
|
309
|
-
activeSDBorder = _this$
|
|
310
|
+
var _this$props2 = this.props,
|
|
311
|
+
playerType = _this$props2.playerType,
|
|
312
|
+
activeSDBorder = _this$props2.activeSDBorder;
|
|
310
313
|
this.handleResize();
|
|
311
314
|
if (activeSDBorder !== prevProps.activeSDBorder) {
|
|
312
315
|
this.actions.handleSDBorderChange(activeSDBorder || false);
|
|
@@ -617,10 +620,10 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
617
620
|
var controlBar = (0, _reactDom.findDOMNode)(this._controlBar);
|
|
618
621
|
var playlist = (0, _reactDom.findDOMNode)(this._playlist);
|
|
619
622
|
var playerContainer = (0, _reactDom.findDOMNode)(this._playerContainer);
|
|
620
|
-
var _this$
|
|
621
|
-
controlType = _this$
|
|
622
|
-
playerType = _this$
|
|
623
|
-
fileType = _this$
|
|
623
|
+
var _this$props3 = this.props,
|
|
624
|
+
controlType = _this$props3.controlType,
|
|
625
|
+
playerType = _this$props3.playerType,
|
|
626
|
+
fileType = _this$props3.fileType;
|
|
624
627
|
var height = 0;
|
|
625
628
|
_toConsumableArray(leftSectionRef.children).forEach(function (child) {
|
|
626
629
|
return height += child.offsetHeight;
|
|
@@ -733,9 +736,9 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
733
736
|
video: this.video ? this.video.video : null
|
|
734
737
|
});
|
|
735
738
|
var childrensLeft = this.getChildren(props, 'left');
|
|
736
|
-
var _this$
|
|
737
|
-
rightSection = _this$
|
|
738
|
-
playerType = _this$
|
|
739
|
+
var _this$props4 = this.props,
|
|
740
|
+
rightSection = _this$props4.rightSection,
|
|
741
|
+
playerType = _this$props4.playerType;
|
|
739
742
|
return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
|
|
740
743
|
ref: function ref(c) {
|
|
741
744
|
_this5.manager.rootElement = c;
|
package/components/Shortcut.js
CHANGED
|
@@ -288,7 +288,7 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
288
288
|
}, {
|
|
289
289
|
keyCode: 73,
|
|
290
290
|
// I Key
|
|
291
|
-
handle:
|
|
291
|
+
handle: function handle(player, actions) {
|
|
292
292
|
var _this$props4 = _this.props,
|
|
293
293
|
markers = _this$props4.markers,
|
|
294
294
|
playerType = _this$props4.playerType,
|
|
@@ -296,88 +296,86 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
296
296
|
playerReadOnlyMode = _this$props4.playerReadOnlyMode,
|
|
297
297
|
disablePlayerActions = _this$props4.disablePlayerActions,
|
|
298
298
|
playerSelectedMarker = _this$props4.playerSelectedMarker,
|
|
299
|
-
frameRate = _this$props4.frameRate
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
if (
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
299
|
+
frameRate = _this$props4.frameRate,
|
|
300
|
+
onMarkerSelect = _this$props4.onMarkerSelect;
|
|
301
|
+
var isHandleDisabled = ["snp_edit", "promo_review", "pgm_edit", "dubbing_review"].includes(playerType);
|
|
302
|
+
if (!isHandleDisabled) {
|
|
303
|
+
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
307
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
308
|
+
args[_key - 2] = arguments[_key];
|
|
309
|
+
}
|
|
310
|
+
var isOverLapTime = args[0].timeAfterOverlap;
|
|
311
|
+
if (isOverLapTime) {
|
|
312
|
+
onAddMarker(args[0].timeAfterOverlap, playerSelectedMarker.rightMarker, 'update');
|
|
313
|
+
} else {
|
|
314
|
+
if (playerType !== 'panel') {
|
|
315
|
+
var createPoint = true;
|
|
316
|
+
if (markers && markers.length && markers[0].values && markers[0].values.length) {
|
|
317
|
+
var markerArr = markers[0].values;
|
|
318
|
+
if (Object.keys(player.selectedMarker).length) {
|
|
319
|
+
markerArr = markerArr.filter(function (marker) {
|
|
320
|
+
return marker.start_time !== player.selectedMarker.leftMarker && marker.end_time !== player.selectedMarker.rightMarker;
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
markerArr.filter(function (marker) {
|
|
324
|
+
if (currentAdjustedTime >= marker.start_time && currentAdjustedTime <= marker.end_time || playerSelectedMarker.leftMarker > -1 && currentAdjustedTime > marker.start_time && playerSelectedMarker.leftMarker < marker.start_time || playerSelectedMarker.leftMarker > -1 && currentAdjustedTime < marker.start_time && playerSelectedMarker.leftMarker > marker.end_time) {
|
|
325
|
+
createPoint = false;
|
|
326
|
+
}
|
|
318
327
|
});
|
|
319
328
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
currentTime: currentAdjustedTime
|
|
340
|
-
};
|
|
341
|
-
onAddMarker(currentAdjustedTime, -1, '', true, data);
|
|
342
|
-
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length)) {
|
|
343
|
-
onAddMarker(currentAdjustedTime, playerSelectedMarker.rightMarker, 'update');
|
|
329
|
+
if (!createPoint && playerSelectedMarker.markerType === 'update' && currentAdjustedTime > player.selectedMarker.leftMarker && currentAdjustedTime < player.selectedMarker.rightMarker) {
|
|
330
|
+
createPoint = true;
|
|
331
|
+
}
|
|
332
|
+
if (createPoint) {
|
|
333
|
+
if (playerSelectedMarker.rightMarker < 0 || playerSelectedMarker.rightMarker > -1 && currentAdjustedTime < playerSelectedMarker.rightMarker) {
|
|
334
|
+
// actions.handleMarkerPointChange(
|
|
335
|
+
// player.markerType !== 'update' ? 'add' : 'update',
|
|
336
|
+
// 'left',
|
|
337
|
+
// currentAdjustedTime
|
|
338
|
+
// );
|
|
339
|
+
var data = {
|
|
340
|
+
markerType: playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length ? 'update' : 'add',
|
|
341
|
+
markerPos: 'left',
|
|
342
|
+
currentTime: currentAdjustedTime
|
|
343
|
+
};
|
|
344
|
+
onAddMarker(currentAdjustedTime, -1, '', true, data);
|
|
345
|
+
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length)) {
|
|
346
|
+
onAddMarker(currentAdjustedTime, playerSelectedMarker.rightMarker, 'update');
|
|
347
|
+
}
|
|
344
348
|
}
|
|
345
349
|
}
|
|
346
350
|
}
|
|
347
351
|
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
playerSelectedMarker
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
//for single annotations here
|
|
360
|
-
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
361
|
-
if (currentAdjustedTime < (playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.rightMarker) || playerSelectedMarker.leftMarker === -1 || playerSelectedMarker.rightMarker === -1) {
|
|
362
|
-
onAddMarker(currentAdjustedTime, playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.rightMarker, '', false, {
|
|
363
|
-
markerType: 'create'
|
|
364
|
-
});
|
|
352
|
+
} else {
|
|
353
|
+
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
//for single annotations here
|
|
357
|
+
var _currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
358
|
+
if (_currentAdjustedTime < (playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.rightMarker) || playerSelectedMarker.leftMarker === -1 || playerSelectedMarker.rightMarker === -1) {
|
|
359
|
+
onAddMarker(_currentAdjustedTime, playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.rightMarker, '', false, {
|
|
360
|
+
markerType: 'create'
|
|
361
|
+
});
|
|
362
|
+
}
|
|
365
363
|
}
|
|
366
364
|
}
|
|
367
365
|
}, {
|
|
368
366
|
keyCode: 79,
|
|
369
367
|
// O Key
|
|
370
368
|
handle: function handle(player, actions) {
|
|
371
|
-
var _this$
|
|
372
|
-
markers = _this$
|
|
373
|
-
onMarkerSelect = _this$
|
|
374
|
-
playerType = _this$
|
|
375
|
-
onAddMarker = _this$
|
|
376
|
-
playerReadOnlyMode = _this$
|
|
377
|
-
disablePlayerActions = _this$
|
|
378
|
-
playerSelectedMarker = _this$
|
|
379
|
-
frameRate = _this$
|
|
380
|
-
pauseOnOutMarkerSelect = _this$
|
|
369
|
+
var _this$props5 = _this.props,
|
|
370
|
+
markers = _this$props5.markers,
|
|
371
|
+
onMarkerSelect = _this$props5.onMarkerSelect,
|
|
372
|
+
playerType = _this$props5.playerType,
|
|
373
|
+
onAddMarker = _this$props5.onAddMarker,
|
|
374
|
+
playerReadOnlyMode = _this$props5.playerReadOnlyMode,
|
|
375
|
+
disablePlayerActions = _this$props5.disablePlayerActions,
|
|
376
|
+
playerSelectedMarker = _this$props5.playerSelectedMarker,
|
|
377
|
+
frameRate = _this$props5.frameRate,
|
|
378
|
+
pauseOnOutMarkerSelect = _this$props5.pauseOnOutMarkerSelect;
|
|
381
379
|
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
382
380
|
return;
|
|
383
381
|
}
|
|
@@ -603,10 +601,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
603
601
|
}, {
|
|
604
602
|
key: "componentDidUpdate",
|
|
605
603
|
value: function componentDidUpdate(prevProps) {
|
|
606
|
-
var _this$
|
|
607
|
-
shortcuts = _this$
|
|
608
|
-
player = _this$
|
|
609
|
-
frameRate = _this$
|
|
604
|
+
var _this$props6 = this.props,
|
|
605
|
+
shortcuts = _this$props6.shortcuts,
|
|
606
|
+
player = _this$props6.player,
|
|
607
|
+
frameRate = _this$props6.frameRate;
|
|
610
608
|
if (prevProps.shortcuts !== shortcuts) {
|
|
611
609
|
this.mergeShortcuts();
|
|
612
610
|
}
|
|
@@ -630,10 +628,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
630
628
|
}, {
|
|
631
629
|
key: "rewindVideo",
|
|
632
630
|
value: function rewindVideo() {
|
|
633
|
-
var _this$
|
|
634
|
-
player = _this$
|
|
635
|
-
actions = _this$
|
|
636
|
-
frameRate = _this$
|
|
631
|
+
var _this$props7 = this.props,
|
|
632
|
+
player = _this$props7.player,
|
|
633
|
+
actions = _this$props7.actions,
|
|
634
|
+
frameRate = _this$props7.frameRate;
|
|
637
635
|
if (player.currentTime == 0 || !player.rewindActive) {
|
|
638
636
|
clearInterval(this.intervalRewind);
|
|
639
637
|
this.intervalRewind = null;
|
|
@@ -762,11 +760,11 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
762
760
|
}, {
|
|
763
761
|
key: "handleKeyPress",
|
|
764
762
|
value: function handleKeyPress(e) {
|
|
765
|
-
var _this$
|
|
766
|
-
player = _this$
|
|
767
|
-
actions = _this$
|
|
768
|
-
frameRate = _this$
|
|
769
|
-
markers = _this$
|
|
763
|
+
var _this$props8 = this.props,
|
|
764
|
+
player = _this$props8.player,
|
|
765
|
+
actions = _this$props8.actions,
|
|
766
|
+
frameRate = _this$props8.frameRate,
|
|
767
|
+
markers = _this$props8.markers;
|
|
770
768
|
if (!player.isActive) {
|
|
771
769
|
return;
|
|
772
770
|
}
|
|
@@ -805,10 +803,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
805
803
|
}, {
|
|
806
804
|
key: "handleClick",
|
|
807
805
|
value: function handleClick(e) {
|
|
808
|
-
var _this$
|
|
809
|
-
player = _this$
|
|
810
|
-
actions = _this$
|
|
811
|
-
clickable = _this$
|
|
806
|
+
var _this$props9 = this.props,
|
|
807
|
+
player = _this$props9.player,
|
|
808
|
+
actions = _this$props9.actions,
|
|
809
|
+
clickable = _this$props9.clickable;
|
|
812
810
|
if (!this.canBeClicked(player, e) || !clickable) {
|
|
813
811
|
return;
|
|
814
812
|
}
|
|
@@ -818,10 +816,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
818
816
|
}, {
|
|
819
817
|
key: "handleDoubleClick",
|
|
820
818
|
value: function handleDoubleClick(e) {
|
|
821
|
-
var _this$
|
|
822
|
-
player = _this$
|
|
823
|
-
actions = _this$
|
|
824
|
-
dblclickable = _this$
|
|
819
|
+
var _this$props10 = this.props,
|
|
820
|
+
player = _this$props10.player,
|
|
821
|
+
actions = _this$props10.actions,
|
|
822
|
+
dblclickable = _this$props10.dblclickable;
|
|
825
823
|
if (!this.canBeClicked(player, e) || !dblclickable) {
|
|
826
824
|
return;
|
|
827
825
|
}
|
package/components/Video.js
CHANGED
|
@@ -100,7 +100,7 @@ var defaultProps = {
|
|
|
100
100
|
var SubTitleSection = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n font-family: SFUIText-Regular;\n font-size: 16px;\n bottom: 20px;\n width: 100%;\n display: flex;\n justify-content: center;\n text-align: center;\n color: #ffffff;\n height: 90%;\n align-items: center;\n\n .subtitleContainer {\n border-radius: 4px;\n width: fit-content;\n background: #000000;\n opacity: 0.9;\n padding: ", ";\n line-height: 20px;\n position: absolute;\n\n i,em {\n font-style: italic; /* Override the font style for <em> tags inside elements with the class .someClass */\n }\n\n strong{\n font-weight: bold; \n }\n \n }\n .longSubtitleStyles {\n overflow-y: auto;\n height: fit-content;\n max-height: 70px;\n max-width: 75%;\n width: fit-content;\n }\n"])), function (props) {
|
|
101
101
|
return props.currentSubtitleObj && props.currentSubtitleObj.line1 ? '8px 10px' : '0px';
|
|
102
102
|
});
|
|
103
|
-
var VideoBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n &.video-react-player-block {\n position: relative;\n transition: all 0.1s ease-in-out;\n -moz-transition: all 0.1s ease-in-out;\n -webkit-transition: all 0.1s ease-in-out;\n -ms-transition: all 0.1s ease-in-out;\n -o-transition: all 0.1s ease-in-out;\n video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n right: 0;\n bottom: 0;\n }\n .audio-tracks {\n position: relative;\n display: flex;\n background: rgba(0, 0, 0, 0.5);\n color: #fff;\n z-index: 10;\n position: absolute;\n width: 100%;\n bottom: 0;\n p {\n cursor: pointer;\n padding: 10px;\n }\n }\n .loader-container {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n z-index: 10;\n background: rgba(0, 0, 0, 0.5);\n }\n }\n &.ratio-border {\n // border: 1px solid rgba(255, 255, 255, 0.5);\n &:after {\n
|
|
103
|
+
var VideoBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n &.video-react-player-block {\n position: relative;\n transition: all 0.1s ease-in-out;\n -moz-transition: all 0.1s ease-in-out;\n -webkit-transition: all 0.1s ease-in-out;\n -ms-transition: all 0.1s ease-in-out;\n -o-transition: all 0.1s ease-in-out;\n video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n right: 0;\n bottom: 0;\n }\n .audio-tracks {\n position: relative;\n display: flex;\n background: rgba(0, 0, 0, 0.5);\n color: #fff;\n z-index: 10;\n position: absolute;\n width: 100%;\n bottom: 0;\n p {\n cursor: pointer;\n padding: 10px;\n }\n }\n .loader-container {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n z-index: 10;\n background: rgba(0, 0, 0, 0.5);\n }\n }\n &.ratio-border {\n // border: 1px solid rgba(255, 255, 255, 0.5);\n &:after {\n content: '16:9 Safe Area';\n position: absolute;\n color: #fff;\n font-family: SFUIText-Regular;\n font-size: 12px;\n transform: rotate(-90deg);\n top: 20%;\n left: -50px;\n }\n }\n"])));
|
|
104
104
|
var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
105
105
|
function Video(props) {
|
|
106
106
|
var _this;
|