@desynova-digital/player 4.0.39 → 4.0.41

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.
@@ -84,6 +84,17 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
84
84
  onTagClick((_values$newIndex2 = values[newIndex]) === null || _values$newIndex2 === void 0 ? void 0 : _values$newIndex2.start_time, (_values$newIndex3 = values[newIndex]) === null || _values$newIndex3 === void 0 ? void 0 : _values$newIndex3.end_time, values[newIndex]);
85
85
  }
86
86
  });
87
+ _defineProperty(_this, "executeShortcut67", function (player, actions) {
88
+ var shortcut = _this.defaultShortcuts.find(function (s) {
89
+ return s.keyCode === 67;
90
+ });
91
+ if (shortcut) {
92
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
93
+ args[_key - 2] = arguments[_key];
94
+ }
95
+ shortcut.handle.apply(shortcut, [player, actions].concat(args));
96
+ }
97
+ });
87
98
  _defineProperty(_this, "debounceSegmentShiftForward", (0, _lodash.debounce)(function () {
88
99
  _this.segmentShift('forward');
89
100
  }, 0));
@@ -286,8 +297,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
286
297
  actions.seek(0); // Go to beginning of video
287
298
  }
288
299
  }, {
289
- keyCode: 73,
290
- // I Key
300
+ keyCode: 67,
301
+ // C Key
291
302
  handle: function handle(player, actions) {
292
303
  var _this$props4 = _this.props,
293
304
  markers = _this$props4.markers,
@@ -304,8 +315,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
304
315
  return;
305
316
  }
306
317
  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];
318
+ for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
319
+ args[_key2 - 2] = arguments[_key2];
309
320
  }
310
321
  var isOverLapTime = args[0].timeAfterOverlap;
311
322
  if (isOverLapTime) {
@@ -363,19 +374,87 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
363
374
  }
364
375
  }
365
376
  }, {
366
- keyCode: 79,
367
- // O Key
377
+ keyCode: 73,
378
+ // I Key
368
379
  handle: function handle(player, actions) {
369
380
  var _this$props5 = _this.props,
370
381
  markers = _this$props5.markers,
371
- onMarkerSelect = _this$props5.onMarkerSelect,
372
382
  playerType = _this$props5.playerType,
373
383
  onAddMarker = _this$props5.onAddMarker,
374
384
  playerReadOnlyMode = _this$props5.playerReadOnlyMode,
375
385
  disablePlayerActions = _this$props5.disablePlayerActions,
376
386
  playerSelectedMarker = _this$props5.playerSelectedMarker,
377
387
  frameRate = _this$props5.frameRate,
378
- pauseOnOutMarkerSelect = _this$props5.pauseOnOutMarkerSelect;
388
+ timelineClicked = _this$props5.timelineClicked;
389
+ if (timelineClicked && ["snp_edit", "promo_review", "pgm_edit", "dubbing_review"].includes(playerType)) {
390
+ var _markers$;
391
+ _this.executeShortcut67(player, actions, frameRate, '', (_markers$ = markers[0]) === null || _markers$ === void 0 ? void 0 : _markers$.values);
392
+ return;
393
+ }
394
+ if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
395
+ return;
396
+ }
397
+ var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
398
+ for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
399
+ args[_key3 - 2] = arguments[_key3];
400
+ }
401
+ var isOverLapTime = args[0].timeAfterOverlap;
402
+ if (isOverLapTime) {
403
+ onAddMarker(args[0].timeAfterOverlap, playerSelectedMarker.rightMarker, 'update');
404
+ } else {
405
+ if (playerType !== 'panel') {
406
+ var createPoint = true;
407
+ if (markers && markers.length && markers[0].values && markers[0].values.length) {
408
+ var markerArr = markers[0].values;
409
+ if (Object.keys(player.selectedMarker).length) {
410
+ markerArr = markerArr.filter(function (marker) {
411
+ return marker.start_time !== player.selectedMarker.leftMarker && marker.end_time !== player.selectedMarker.rightMarker;
412
+ });
413
+ }
414
+ markerArr.filter(function (marker) {
415
+ 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) {
416
+ createPoint = false;
417
+ }
418
+ });
419
+ }
420
+ if (!createPoint && playerSelectedMarker.markerType === 'update' && currentAdjustedTime > player.selectedMarker.leftMarker && currentAdjustedTime < player.selectedMarker.rightMarker) {
421
+ createPoint = true;
422
+ }
423
+ if (createPoint) {
424
+ if (playerSelectedMarker.rightMarker < 0 || playerSelectedMarker.rightMarker > -1 && currentAdjustedTime < playerSelectedMarker.rightMarker) {
425
+ // actions.handleMarkerPointChange(
426
+ // player.markerType !== 'update' ? 'add' : 'update',
427
+ // 'left',
428
+ // currentAdjustedTime
429
+ // );
430
+ var data = {
431
+ markerType: playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length ? 'update' : 'add',
432
+ markerPos: 'left',
433
+ currentTime: currentAdjustedTime
434
+ };
435
+ onAddMarker(currentAdjustedTime, -1, '', true, data);
436
+ if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length)) {
437
+ onAddMarker(currentAdjustedTime, playerSelectedMarker.rightMarker, 'update');
438
+ }
439
+ }
440
+ }
441
+ }
442
+ }
443
+ }
444
+ }, {
445
+ keyCode: 79,
446
+ // O Key
447
+ handle: function handle(player, actions) {
448
+ var _this$props6 = _this.props,
449
+ markers = _this$props6.markers,
450
+ onMarkerSelect = _this$props6.onMarkerSelect,
451
+ playerType = _this$props6.playerType,
452
+ onAddMarker = _this$props6.onAddMarker,
453
+ playerReadOnlyMode = _this$props6.playerReadOnlyMode,
454
+ disablePlayerActions = _this$props6.disablePlayerActions,
455
+ playerSelectedMarker = _this$props6.playerSelectedMarker,
456
+ frameRate = _this$props6.frameRate,
457
+ pauseOnOutMarkerSelect = _this$props6.pauseOnOutMarkerSelect;
379
458
  if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
380
459
  return;
381
460
  }
@@ -387,8 +466,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
387
466
  actions.seek(player.currentTime);
388
467
  }
389
468
  var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
390
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
391
- args[_key2 - 2] = arguments[_key2];
469
+ for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {
470
+ args[_key4 - 2] = arguments[_key4];
392
471
  }
393
472
  var isOverLapTime = args[0].timeAfterOverlap;
394
473
  if (isOverLapTime) {
@@ -601,10 +680,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
601
680
  }, {
602
681
  key: "componentDidUpdate",
603
682
  value: function componentDidUpdate(prevProps) {
604
- var _this$props6 = this.props,
605
- shortcuts = _this$props6.shortcuts,
606
- player = _this$props6.player,
607
- frameRate = _this$props6.frameRate;
683
+ var _this$props7 = this.props,
684
+ shortcuts = _this$props7.shortcuts,
685
+ player = _this$props7.player,
686
+ frameRate = _this$props7.frameRate;
608
687
  if (prevProps.shortcuts !== shortcuts) {
609
688
  this.mergeShortcuts();
610
689
  }
@@ -628,10 +707,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
628
707
  }, {
629
708
  key: "rewindVideo",
630
709
  value: function rewindVideo() {
631
- var _this$props7 = this.props,
632
- player = _this$props7.player,
633
- actions = _this$props7.actions,
634
- frameRate = _this$props7.frameRate;
710
+ var _this$props8 = this.props,
711
+ player = _this$props8.player,
712
+ actions = _this$props8.actions,
713
+ frameRate = _this$props8.frameRate;
635
714
  if (player.currentTime == 0 || !player.rewindActive) {
636
715
  clearInterval(this.intervalRewind);
637
716
  this.intervalRewind = null;
@@ -760,11 +839,11 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
760
839
  }, {
761
840
  key: "handleKeyPress",
762
841
  value: function handleKeyPress(e) {
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;
842
+ var _this$props9 = this.props,
843
+ player = _this$props9.player,
844
+ actions = _this$props9.actions,
845
+ frameRate = _this$props9.frameRate,
846
+ markers = _this$props9.markers;
768
847
  if (!player.isActive) {
769
848
  return;
770
849
  }
@@ -785,8 +864,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
785
864
  return true;
786
865
  })[0];
787
866
  if (shortcut) {
788
- var _markers$;
789
- shortcut.handle(player, actions, frameRate, e, (_markers$ = markers[0]) === null || _markers$ === void 0 ? void 0 : _markers$.values);
867
+ var _markers$2;
868
+ shortcut.handle(player, actions, frameRate, e, (_markers$2 = markers[0]) === null || _markers$2 === void 0 ? void 0 : _markers$2.values);
790
869
  e.preventDefault();
791
870
  }
792
871
  }
@@ -803,10 +882,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
803
882
  }, {
804
883
  key: "handleClick",
805
884
  value: function handleClick(e) {
806
- var _this$props9 = this.props,
807
- player = _this$props9.player,
808
- actions = _this$props9.actions,
809
- clickable = _this$props9.clickable;
885
+ var _this$props10 = this.props,
886
+ player = _this$props10.player,
887
+ actions = _this$props10.actions,
888
+ clickable = _this$props10.clickable;
810
889
  if (!this.canBeClicked(player, e) || !clickable) {
811
890
  return;
812
891
  }
@@ -816,10 +895,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
816
895
  }, {
817
896
  key: "handleDoubleClick",
818
897
  value: function handleDoubleClick(e) {
819
- var _this$props10 = this.props,
820
- player = _this$props10.player,
821
- actions = _this$props10.actions,
822
- dblclickable = _this$props10.dblclickable;
898
+ var _this$props11 = this.props,
899
+ player = _this$props11.player,
900
+ actions = _this$props11.actions,
901
+ dblclickable = _this$props11.dblclickable;
823
902
  if (!this.canBeClicked(player, e) || !dblclickable) {
824
903
  return;
825
904
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desynova-digital/player",
3
- "version": "4.0.39",
3
+ "version": "4.0.41",
4
4
  "description": "Video Player Package for Contido Application",
5
5
  "main": "index.js",
6
6
  "scripts": {