@desynova-digital/player 3.13.18 → 3.13.20
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/Shortcut.js +63 -54
- package/package.json +1 -1
package/components/Shortcut.js
CHANGED
|
@@ -66,6 +66,9 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
66
66
|
*/
|
|
67
67
|
_defineProperty(_assertThisInitialized(_this), "handleKeyMovement", function (keyCode) {
|
|
68
68
|
var _this$props$markers$, _this$props$playerSel, _this$props$player, _this$props$player2;
|
|
69
|
+
if (keyCode === 81 || keyCode === 87) {
|
|
70
|
+
_this.isCalled = true;
|
|
71
|
+
}
|
|
69
72
|
var frameRateNumber = parseInt(_this.props.frameRate);
|
|
70
73
|
var timeAfterOverlap;
|
|
71
74
|
var keyPressHandle = _this.defaultShortcuts.find(function (shortcut) {
|
|
@@ -94,6 +97,12 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
94
97
|
* Once we leave the keyCombo isCalled variable is set to false. This ensures that on the next combo press we will again execute Q/W key combo first.
|
|
95
98
|
*/
|
|
96
99
|
_defineProperty(_assertThisInitialized(_this), "createThreeKeyCombo", function (event, handleKeyMovement, debounceKeyFunc, keyParameter) {
|
|
100
|
+
var _this$props = _this.props,
|
|
101
|
+
playerReadOnlyMode = _this$props.playerReadOnlyMode,
|
|
102
|
+
disablePlayerActions = _this$props.disablePlayerActions;
|
|
103
|
+
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
97
106
|
if (!_this.isCalled) {
|
|
98
107
|
handleKeyMovement();
|
|
99
108
|
}
|
|
@@ -241,13 +250,13 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
241
250
|
keyCode: 73,
|
|
242
251
|
// I Key
|
|
243
252
|
handle: function handle(player, actions) {
|
|
244
|
-
var _this$
|
|
245
|
-
markers = _this$
|
|
246
|
-
playerType = _this$
|
|
247
|
-
onAddMarker = _this$
|
|
248
|
-
playerReadOnlyMode = _this$
|
|
249
|
-
disablePlayerActions = _this$
|
|
250
|
-
playerSelectedMarker = _this$
|
|
253
|
+
var _this$props2 = _this.props,
|
|
254
|
+
markers = _this$props2.markers,
|
|
255
|
+
playerType = _this$props2.playerType,
|
|
256
|
+
onAddMarker = _this$props2.onAddMarker,
|
|
257
|
+
playerReadOnlyMode = _this$props2.playerReadOnlyMode,
|
|
258
|
+
disablePlayerActions = _this$props2.disablePlayerActions,
|
|
259
|
+
playerSelectedMarker = _this$props2.playerSelectedMarker;
|
|
251
260
|
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
252
261
|
return;
|
|
253
262
|
}
|
|
@@ -301,14 +310,14 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
301
310
|
keyCode: 79,
|
|
302
311
|
// O Key
|
|
303
312
|
handle: function handle(player, actions) {
|
|
304
|
-
var _this$
|
|
305
|
-
markers = _this$
|
|
306
|
-
onMarkerSelect = _this$
|
|
307
|
-
playerType = _this$
|
|
308
|
-
onAddMarker = _this$
|
|
309
|
-
playerReadOnlyMode = _this$
|
|
310
|
-
disablePlayerActions = _this$
|
|
311
|
-
playerSelectedMarker = _this$
|
|
313
|
+
var _this$props3 = _this.props,
|
|
314
|
+
markers = _this$props3.markers,
|
|
315
|
+
onMarkerSelect = _this$props3.onMarkerSelect,
|
|
316
|
+
playerType = _this$props3.playerType,
|
|
317
|
+
onAddMarker = _this$props3.onAddMarker,
|
|
318
|
+
playerReadOnlyMode = _this$props3.playerReadOnlyMode,
|
|
319
|
+
disablePlayerActions = _this$props3.disablePlayerActions,
|
|
320
|
+
playerSelectedMarker = _this$props3.playerSelectedMarker;
|
|
312
321
|
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
313
322
|
return;
|
|
314
323
|
}
|
|
@@ -464,9 +473,9 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
464
473
|
//'ctrl + ['
|
|
465
474
|
ctrl: true,
|
|
466
475
|
handle: function handle(player, actions, frameRate, e, markers) {
|
|
467
|
-
var _this$
|
|
468
|
-
leftMarker = _this$
|
|
469
|
-
onTagClick = _this$
|
|
476
|
+
var _this$props4 = _this.props,
|
|
477
|
+
leftMarker = _this$props4.playerSelectedMarker.leftMarker,
|
|
478
|
+
onTagClick = _this$props4.onTagClick;
|
|
470
479
|
var newIndex = markers.findIndex(function (item) {
|
|
471
480
|
return item.in_time === leftMarker;
|
|
472
481
|
}) - 1;
|
|
@@ -481,9 +490,9 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
481
490
|
//'ctrl + ]'
|
|
482
491
|
ctrl: true,
|
|
483
492
|
handle: function handle(player, actions, frameRate, e, markers) {
|
|
484
|
-
var _this$
|
|
485
|
-
leftMarker = _this$
|
|
486
|
-
onTagClick = _this$
|
|
493
|
+
var _this$props5 = _this.props,
|
|
494
|
+
leftMarker = _this$props5.playerSelectedMarker.leftMarker,
|
|
495
|
+
onTagClick = _this$props5.onTagClick;
|
|
487
496
|
var newIndex = markers.findIndex(function (item) {
|
|
488
497
|
return item.in_time === leftMarker;
|
|
489
498
|
}) + 1;
|
|
@@ -506,22 +515,22 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
506
515
|
key: "componentDidMount",
|
|
507
516
|
value: function componentDidMount() {
|
|
508
517
|
this.mergeShortcuts();
|
|
509
|
-
(0, _hotkeysJs["default"])('
|
|
518
|
+
(0, _hotkeysJs["default"])('o+right,right+o', {
|
|
510
519
|
keyup: true,
|
|
511
520
|
keydown: true
|
|
512
|
-
}, this.
|
|
513
|
-
(0, _hotkeysJs["default"])('
|
|
521
|
+
}, this.threeKeyCombo1);
|
|
522
|
+
(0, _hotkeysJs["default"])('o+left,left+o', {
|
|
514
523
|
keyup: true,
|
|
515
524
|
keydown: true
|
|
516
|
-
}, this.
|
|
517
|
-
(0, _hotkeysJs["default"])('
|
|
525
|
+
}, this.threeKeyCombo2);
|
|
526
|
+
(0, _hotkeysJs["default"])('i+right,right+i', {
|
|
518
527
|
keyup: true,
|
|
519
528
|
keydown: true
|
|
520
|
-
}, this.
|
|
521
|
-
(0, _hotkeysJs["default"])('
|
|
529
|
+
}, this.threeKeyCombo3);
|
|
530
|
+
(0, _hotkeysJs["default"])('i+left,left+i', {
|
|
522
531
|
keyup: true,
|
|
523
532
|
keydown: true
|
|
524
|
-
}, this.
|
|
533
|
+
}, this.threeKeyCombo4);
|
|
525
534
|
document.addEventListener('keydown', this.handleKeyPress);
|
|
526
535
|
document.addEventListener('click', this.handleClick);
|
|
527
536
|
document.addEventListener('dblclick', this.handleDoubleClick);
|
|
@@ -549,10 +558,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
549
558
|
}, {
|
|
550
559
|
key: "componentDidUpdate",
|
|
551
560
|
value: function componentDidUpdate(prevProps) {
|
|
552
|
-
var _this$
|
|
553
|
-
shortcuts = _this$
|
|
554
|
-
player = _this$
|
|
555
|
-
frameRate = _this$
|
|
561
|
+
var _this$props6 = this.props,
|
|
562
|
+
shortcuts = _this$props6.shortcuts,
|
|
563
|
+
player = _this$props6.player,
|
|
564
|
+
frameRate = _this$props6.frameRate;
|
|
556
565
|
if (prevProps.shortcuts !== shortcuts) {
|
|
557
566
|
this.mergeShortcuts();
|
|
558
567
|
}
|
|
@@ -565,10 +574,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
565
574
|
}, {
|
|
566
575
|
key: "componentWillUnmount",
|
|
567
576
|
value: function componentWillUnmount() {
|
|
568
|
-
_hotkeysJs["default"].unbind('
|
|
569
|
-
_hotkeysJs["default"].unbind('
|
|
570
|
-
_hotkeysJs["default"].unbind('
|
|
571
|
-
_hotkeysJs["default"].unbind('
|
|
577
|
+
_hotkeysJs["default"].unbind('o+right,right+o');
|
|
578
|
+
_hotkeysJs["default"].unbind('i+right,right+i');
|
|
579
|
+
_hotkeysJs["default"].unbind('i+left,left+i');
|
|
580
|
+
_hotkeysJs["default"].unbind('o+left,left+o');
|
|
572
581
|
document.removeEventListener('keydown', this.handleKeyPress);
|
|
573
582
|
document.removeEventListener('click', this.handleClick);
|
|
574
583
|
document.removeEventListener('dblclick', this.handleDoubleClick);
|
|
@@ -576,10 +585,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
576
585
|
}, {
|
|
577
586
|
key: "rewindVideo",
|
|
578
587
|
value: function rewindVideo() {
|
|
579
|
-
var _this$
|
|
580
|
-
player = _this$
|
|
581
|
-
actions = _this$
|
|
582
|
-
frameRate = _this$
|
|
588
|
+
var _this$props7 = this.props,
|
|
589
|
+
player = _this$props7.player,
|
|
590
|
+
actions = _this$props7.actions,
|
|
591
|
+
frameRate = _this$props7.frameRate;
|
|
583
592
|
if (player.currentTime == 0 || !player.rewindActive) {
|
|
584
593
|
clearInterval(this.intervalRewind);
|
|
585
594
|
this.intervalRewind = null;
|
|
@@ -708,11 +717,11 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
708
717
|
}, {
|
|
709
718
|
key: "handleKeyPress",
|
|
710
719
|
value: function handleKeyPress(e) {
|
|
711
|
-
var _this$
|
|
712
|
-
player = _this$
|
|
713
|
-
actions = _this$
|
|
714
|
-
frameRate = _this$
|
|
715
|
-
markers = _this$
|
|
720
|
+
var _this$props8 = this.props,
|
|
721
|
+
player = _this$props8.player,
|
|
722
|
+
actions = _this$props8.actions,
|
|
723
|
+
frameRate = _this$props8.frameRate,
|
|
724
|
+
markers = _this$props8.markers;
|
|
716
725
|
if (!player.isActive) {
|
|
717
726
|
return;
|
|
718
727
|
}
|
|
@@ -751,10 +760,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
751
760
|
}, {
|
|
752
761
|
key: "handleClick",
|
|
753
762
|
value: function handleClick(e) {
|
|
754
|
-
var _this$
|
|
755
|
-
player = _this$
|
|
756
|
-
actions = _this$
|
|
757
|
-
clickable = _this$
|
|
763
|
+
var _this$props9 = this.props,
|
|
764
|
+
player = _this$props9.player,
|
|
765
|
+
actions = _this$props9.actions,
|
|
766
|
+
clickable = _this$props9.clickable;
|
|
758
767
|
if (!this.canBeClicked(player, e) || !clickable) {
|
|
759
768
|
return;
|
|
760
769
|
}
|
|
@@ -764,10 +773,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
764
773
|
}, {
|
|
765
774
|
key: "handleDoubleClick",
|
|
766
775
|
value: function handleDoubleClick(e) {
|
|
767
|
-
var _this$
|
|
768
|
-
player = _this$
|
|
769
|
-
actions = _this$
|
|
770
|
-
dblclickable = _this$
|
|
776
|
+
var _this$props10 = this.props,
|
|
777
|
+
player = _this$props10.player,
|
|
778
|
+
actions = _this$props10.actions,
|
|
779
|
+
dblclickable = _this$props10.dblclickable;
|
|
771
780
|
if (!this.canBeClicked(player, e) || !dblclickable) {
|
|
772
781
|
return;
|
|
773
782
|
}
|