@desynova-digital/player 4.0.26 → 4.0.27
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 +3 -1
- package/components/Shortcut.js +51 -34
- package/components/control-bar/ControlBar.js +6 -2
- package/components/control-bar/SettingsMenuButton.js +2 -2
- package/components/marking-controls/MarkInControl.js +15 -3
- package/components/marking-controls/MarkingControl.js +4 -1
- package/components/settings-menu-control/SettingsMenu.js +2 -2
- package/package.json +1 -1
package/components/Player.js
CHANGED
|
@@ -291,12 +291,14 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
291
291
|
},
|
|
292
292
|
key: "control-bar",
|
|
293
293
|
pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
|
|
294
|
-
order: 4
|
|
294
|
+
order: 4,
|
|
295
|
+
playerType: fullProps.playerType
|
|
295
296
|
}, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
|
|
296
297
|
key: "shortcut",
|
|
297
298
|
order: 99.0
|
|
298
299
|
}, props, {
|
|
299
300
|
pauseOnOutMarkerSelect: fullProps.pauseOnOutMarkerSelect,
|
|
301
|
+
playerType: fullProps.playerType,
|
|
300
302
|
frameRate: fullProps.frameRate
|
|
301
303
|
}))];
|
|
302
304
|
}
|
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: function
|
|
291
|
+
handle: !["snp_edit", "promo", "pgm_edit"].includes(_this.props.playerType) ? function (player, actions) {
|
|
292
292
|
var _this$props4 = _this.props,
|
|
293
293
|
markers = _this$props4.markers,
|
|
294
294
|
playerType = _this$props4.playerType,
|
|
@@ -346,21 +346,38 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
}
|
|
350
|
-
}, {
|
|
351
|
-
keyCode: 79,
|
|
352
|
-
// O Key
|
|
353
|
-
handle: function handle(player, actions) {
|
|
349
|
+
} : function (player) {
|
|
354
350
|
var _this$props5 = _this.props,
|
|
355
|
-
markers = _this$props5.markers,
|
|
356
|
-
onMarkerSelect = _this$props5.onMarkerSelect,
|
|
357
|
-
playerType = _this$props5.playerType,
|
|
358
351
|
onAddMarker = _this$props5.onAddMarker,
|
|
359
352
|
playerReadOnlyMode = _this$props5.playerReadOnlyMode,
|
|
360
353
|
disablePlayerActions = _this$props5.disablePlayerActions,
|
|
361
354
|
playerSelectedMarker = _this$props5.playerSelectedMarker,
|
|
362
|
-
frameRate = _this$props5.frameRate
|
|
363
|
-
|
|
355
|
+
frameRate = _this$props5.frameRate;
|
|
356
|
+
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
357
|
+
return;
|
|
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
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}, {
|
|
368
|
+
keyCode: 79,
|
|
369
|
+
// O Key
|
|
370
|
+
handle: function handle(player, actions) {
|
|
371
|
+
var _this$props6 = _this.props,
|
|
372
|
+
markers = _this$props6.markers,
|
|
373
|
+
onMarkerSelect = _this$props6.onMarkerSelect,
|
|
374
|
+
playerType = _this$props6.playerType,
|
|
375
|
+
onAddMarker = _this$props6.onAddMarker,
|
|
376
|
+
playerReadOnlyMode = _this$props6.playerReadOnlyMode,
|
|
377
|
+
disablePlayerActions = _this$props6.disablePlayerActions,
|
|
378
|
+
playerSelectedMarker = _this$props6.playerSelectedMarker,
|
|
379
|
+
frameRate = _this$props6.frameRate,
|
|
380
|
+
pauseOnOutMarkerSelect = _this$props6.pauseOnOutMarkerSelect;
|
|
364
381
|
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
365
382
|
return;
|
|
366
383
|
}
|
|
@@ -413,7 +430,7 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
413
430
|
markerPos: 'right',
|
|
414
431
|
currentTime: currentAdjustedTime
|
|
415
432
|
};
|
|
416
|
-
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length)) {
|
|
433
|
+
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length) && !["snp_edit", "promo", "pgm_edit"].includes(playerType)) {
|
|
417
434
|
onAddMarker(playerSelectedMarker.leftMarker, currentAdjustedTime, 'update', false, _data);
|
|
418
435
|
}
|
|
419
436
|
//Commented for CN-632.
|
|
@@ -422,7 +439,7 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
422
439
|
// }
|
|
423
440
|
}
|
|
424
441
|
}
|
|
425
|
-
if (playerSelectedMarker.leftMarker > -1 && currentAdjustedTime > -1 && playerSelectedMarker.markerCreate && createPoint && currentAdjustedTime > playerSelectedMarker.leftMarker) {
|
|
442
|
+
if (playerSelectedMarker.leftMarker > -1 && currentAdjustedTime > -1 && (playerSelectedMarker.markerCreate || ["snp_edit", "promo", "pgm_edit"].includes(playerType)) && createPoint && currentAdjustedTime > playerSelectedMarker.leftMarker) {
|
|
426
443
|
// actions.handleMarkerPointChange('create');
|
|
427
444
|
onAddMarker(playerSelectedMarker.leftMarker, currentAdjustedTime, '', false, {
|
|
428
445
|
markerType: 'create'
|
|
@@ -586,10 +603,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
586
603
|
}, {
|
|
587
604
|
key: "componentDidUpdate",
|
|
588
605
|
value: function componentDidUpdate(prevProps) {
|
|
589
|
-
var _this$
|
|
590
|
-
shortcuts = _this$
|
|
591
|
-
player = _this$
|
|
592
|
-
frameRate = _this$
|
|
606
|
+
var _this$props7 = this.props,
|
|
607
|
+
shortcuts = _this$props7.shortcuts,
|
|
608
|
+
player = _this$props7.player,
|
|
609
|
+
frameRate = _this$props7.frameRate;
|
|
593
610
|
if (prevProps.shortcuts !== shortcuts) {
|
|
594
611
|
this.mergeShortcuts();
|
|
595
612
|
}
|
|
@@ -613,10 +630,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
613
630
|
}, {
|
|
614
631
|
key: "rewindVideo",
|
|
615
632
|
value: function rewindVideo() {
|
|
616
|
-
var _this$
|
|
617
|
-
player = _this$
|
|
618
|
-
actions = _this$
|
|
619
|
-
frameRate = _this$
|
|
633
|
+
var _this$props8 = this.props,
|
|
634
|
+
player = _this$props8.player,
|
|
635
|
+
actions = _this$props8.actions,
|
|
636
|
+
frameRate = _this$props8.frameRate;
|
|
620
637
|
if (player.currentTime == 0 || !player.rewindActive) {
|
|
621
638
|
clearInterval(this.intervalRewind);
|
|
622
639
|
this.intervalRewind = null;
|
|
@@ -745,11 +762,11 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
745
762
|
}, {
|
|
746
763
|
key: "handleKeyPress",
|
|
747
764
|
value: function handleKeyPress(e) {
|
|
748
|
-
var _this$
|
|
749
|
-
player = _this$
|
|
750
|
-
actions = _this$
|
|
751
|
-
frameRate = _this$
|
|
752
|
-
markers = _this$
|
|
765
|
+
var _this$props9 = this.props,
|
|
766
|
+
player = _this$props9.player,
|
|
767
|
+
actions = _this$props9.actions,
|
|
768
|
+
frameRate = _this$props9.frameRate,
|
|
769
|
+
markers = _this$props9.markers;
|
|
753
770
|
if (!player.isActive) {
|
|
754
771
|
return;
|
|
755
772
|
}
|
|
@@ -788,10 +805,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
788
805
|
}, {
|
|
789
806
|
key: "handleClick",
|
|
790
807
|
value: function handleClick(e) {
|
|
791
|
-
var _this$
|
|
792
|
-
player = _this$
|
|
793
|
-
actions = _this$
|
|
794
|
-
clickable = _this$
|
|
808
|
+
var _this$props10 = this.props,
|
|
809
|
+
player = _this$props10.player,
|
|
810
|
+
actions = _this$props10.actions,
|
|
811
|
+
clickable = _this$props10.clickable;
|
|
795
812
|
if (!this.canBeClicked(player, e) || !clickable) {
|
|
796
813
|
return;
|
|
797
814
|
}
|
|
@@ -801,10 +818,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
801
818
|
}, {
|
|
802
819
|
key: "handleDoubleClick",
|
|
803
820
|
value: function handleDoubleClick(e) {
|
|
804
|
-
var _this$
|
|
805
|
-
player = _this$
|
|
806
|
-
actions = _this$
|
|
807
|
-
dblclickable = _this$
|
|
821
|
+
var _this$props11 = this.props,
|
|
822
|
+
player = _this$props11.player,
|
|
823
|
+
actions = _this$props11.actions,
|
|
824
|
+
dblclickable = _this$props11.dblclickable;
|
|
808
825
|
if (!this.canBeClicked(player, e) || !dblclickable) {
|
|
809
826
|
return;
|
|
810
827
|
}
|
|
@@ -108,7 +108,9 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
108
108
|
})), /*#__PURE__*/_react["default"].createElement(_DurationDisplay["default"], _extends({}, this.props, {
|
|
109
109
|
key: "duration-display",
|
|
110
110
|
order: 5.3
|
|
111
|
-
})), /*#__PURE__*/_react["default"].createElement(_MarkingControl["default"], _extends({
|
|
111
|
+
})), /*#__PURE__*/_react["default"].createElement(_MarkingControl["default"], _extends({
|
|
112
|
+
playerType: playerType
|
|
113
|
+
}, this.props, {
|
|
112
114
|
key: "marking-controls",
|
|
113
115
|
order: 6
|
|
114
116
|
})),
|
|
@@ -182,7 +184,9 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
182
184
|
})), /*#__PURE__*/_react["default"].createElement(_DurationDisplay["default"], _extends({}, this.props, {
|
|
183
185
|
key: "duration-display",
|
|
184
186
|
order: 5.3
|
|
185
|
-
})), /*#__PURE__*/_react["default"].createElement(_MarkingControl["default"], _extends({
|
|
187
|
+
})), /*#__PURE__*/_react["default"].createElement(_MarkingControl["default"], _extends({
|
|
188
|
+
playerType: playerType
|
|
189
|
+
}, this.props, {
|
|
186
190
|
key: "marking-controls",
|
|
187
191
|
order: 6
|
|
188
192
|
})),
|
|
@@ -11,8 +11,8 @@ var _SettingsMenu = _interopRequireDefault(require("../settings-menu-control/Set
|
|
|
11
11
|
var _excluded = ["style", "player", "actions", "disablePlayerActions", "theme", "playerType", "subtitleData"];
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
13
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
15
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
14
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
16
16
|
var propTypes = {
|
|
17
17
|
player: _propTypes.PropTypes.instanceOf(Object),
|
|
18
18
|
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
@@ -90,15 +90,27 @@ var MarkInControl = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
90
90
|
actions = _this$props2.actions,
|
|
91
91
|
onAddMarker = _this$props2.onAddMarker,
|
|
92
92
|
frameRate = _this$props2.frameRate;
|
|
93
|
-
|
|
94
|
-
if (onAddMarker) {
|
|
93
|
+
if (["snp_edit", "promo", "pgm_edit"].includes(playerType)) {
|
|
95
94
|
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
96
95
|
var data = {
|
|
97
96
|
markerType: player.markerType !== 'update' ? 'add' : 'update',
|
|
98
97
|
markerPos: 'left',
|
|
99
98
|
currentTime: currentAdjustedTime
|
|
100
99
|
};
|
|
101
|
-
onAddMarker(currentAdjustedTime, -1, '',
|
|
100
|
+
onAddMarker(currentAdjustedTime, -1, '', false, {
|
|
101
|
+
markerType: 'create'
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
// actions.handleMarkerPointChange('add', 'left', player.currentTime);
|
|
105
|
+
if (onAddMarker) {
|
|
106
|
+
var _currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
107
|
+
var _data = {
|
|
108
|
+
markerType: player.markerType !== 'update' ? 'add' : 'update',
|
|
109
|
+
markerPos: 'left',
|
|
110
|
+
currentTime: _currentAdjustedTime
|
|
111
|
+
};
|
|
112
|
+
onAddMarker(_currentAdjustedTime, -1, '', true, _data);
|
|
113
|
+
}
|
|
102
114
|
}
|
|
103
115
|
}
|
|
104
116
|
}, {
|
|
@@ -54,6 +54,7 @@ function MarkingControl(_ref) {
|
|
|
54
54
|
disablePlayerActions = _ref$disablePlayerAct === void 0 ? [] : _ref$disablePlayerAct,
|
|
55
55
|
playerSelectedMarker = _ref.playerSelectedMarker,
|
|
56
56
|
theme = _ref.theme,
|
|
57
|
+
enablePlayerActions = _ref.enablePlayerActions,
|
|
57
58
|
pauseOnOutMarkerSelect = _ref.pauseOnOutMarkerSelect;
|
|
58
59
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, playerType !== 'panel' && playerType !== 'default' && playerType !== 'clipping_default' ? /*#__PURE__*/_react["default"].createElement(MarkingBlock, {
|
|
59
60
|
theme: theme
|
|
@@ -64,7 +65,9 @@ function MarkingControl(_ref) {
|
|
|
64
65
|
player: player,
|
|
65
66
|
markers: markers,
|
|
66
67
|
allowMarkerOverlap: allowMarkerOverlap,
|
|
67
|
-
onAddMarker: onAddMarker
|
|
68
|
+
onAddMarker: onAddMarker,
|
|
69
|
+
enablePlayerActions: enablePlayerActions,
|
|
70
|
+
playerType: playerType
|
|
68
71
|
}), /*#__PURE__*/_react["default"].createElement(_MarkOutControl["default"], {
|
|
69
72
|
theme: theme,
|
|
70
73
|
leftMarker: playerSelectedMarker === null || playerSelectedMarker === void 0 ? void 0 : playerSelectedMarker.leftMarker,
|
|
@@ -26,8 +26,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
26
26
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
27
27
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
28
28
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
29
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
30
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
29
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
30
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
31
31
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
32
32
|
/*
|
|
33
33
|
* import SubtitleControl from './SubtitleControl';
|