@desynova-digital/player 4.0.40 → 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.
- package/Manager.js +8 -9
- package/actions/player.js +1 -1
- package/components/AudioMeter.js +27 -28
- package/components/BigPlayButton.js +16 -17
- package/components/ImageViewer.js +16 -17
- package/components/MarkerBar.js +16 -17
- package/components/Menu.js +2 -2
- package/components/Player.js +45 -46
- package/components/PlayerHeader.js +23 -24
- package/components/Playlist.js +14 -15
- package/components/PointersBar.js +19 -20
- package/components/PosterImage.js +1 -1
- package/components/SDOutline.js +2 -2
- package/components/Shortcut.js +94 -78
- package/components/Slider.js +33 -33
- package/components/TagsBar.js +15 -16
- package/components/Video.js +111 -112
- package/components/control-bar/AudioTracksMenuButton.js +14 -15
- package/components/control-bar/CameraButton.js +15 -16
- package/components/control-bar/CaptionControlMenuButton.js +19 -20
- package/components/control-bar/CommentsButton.js +16 -17
- package/components/control-bar/ControlBar.js +17 -18
- package/components/control-bar/EditorControlMenuButton.js +16 -17
- package/components/control-bar/ForwardControl.js +1 -1
- package/components/control-bar/ForwardReplayControl.js +15 -16
- package/components/control-bar/FullscreenToggle.js +15 -16
- package/components/control-bar/PlayToggle.js +15 -16
- package/components/control-bar/ReplayControl.js +1 -1
- package/components/control-bar/SettingsMenuButton.js +4 -4
- package/components/control-bar/SubtitleLanguagesMenuButton.js +14 -15
- package/components/control-bar/SubtitleMovementMenu.js +16 -17
- package/components/control-bar/VolumeMenuButton.js +16 -17
- package/components/control-bar/ZoomMenuButton.js +16 -17
- package/components/marking-controls/MarkInControl.js +15 -16
- package/components/marking-controls/MarkOutControl.js +15 -16
- package/components/marking-controls/MarkingAddButton.js +15 -16
- package/components/marking-controls/MarkingControl.js +2 -2
- package/components/marking-controls/MarkingDeleteButton.js +15 -16
- package/components/marking-controls/MarkingDuration.js +2 -2
- package/components/marking-controls/MarkingPreview.js +15 -16
- package/components/progress-bar/AudioWaveform.js +15 -16
- package/components/progress-bar/LoadProgressBar.js +1 -1
- package/components/progress-bar/MouseTimeDisplay.js +1 -1
- package/components/progress-bar/PlayProgressBar.js +2 -2
- package/components/progress-bar/ProgressControl.js +19 -20
- package/components/progress-bar/SeekBar.js +27 -28
- package/components/progress-bar/Timeline.js +15 -16
- package/components/settings-menu-control/CameraControl.js +3 -3
- package/components/settings-menu-control/ChildMenuComponent.js +28 -29
- package/components/settings-menu-control/ParentMenuComponent.js +17 -18
- package/components/settings-menu-control/PlaybackRateControl.js +15 -16
- package/components/settings-menu-control/SafeAreaControl.js +15 -16
- package/components/settings-menu-control/SettingsMenu.js +12 -12
- package/components/time-controls/CurrentTimeDisplay.js +7 -7
- package/components/time-controls/DurationDisplay.js +2 -2
- package/components/time-controls/TimeDivider.js +2 -2
- package/components/volume-control/VolumeBar.js +24 -25
- package/components/volume-control/VolumeControl.js +1 -1
- package/components/volume-control/VolumeLevel.js +2 -2
- package/components/zoom-control/ZoomBar.js +23 -24
- package/components/zoom-control/ZoomLevel.js +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
- package/reducers/operation.js +2 -2
- package/reducers/player.js +2 -2
- package/utils/browser.js +14 -14
- package/utils/dom.js +18 -18
- package/utils/fullscreen.js +5 -6
- package/utils/index.js +54 -54
package/components/Shortcut.js
CHANGED
|
@@ -9,30 +9,30 @@ var _propTypes = require("prop-types");
|
|
|
9
9
|
var _lodash = require("lodash");
|
|
10
10
|
var _hotkeysJs = _interopRequireDefault(require("hotkeys-js"));
|
|
11
11
|
var _utils = require("../utils");
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
13
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
-
function _toConsumableArray(
|
|
14
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
15
15
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
function _iterableToArray(
|
|
17
|
-
function _arrayWithoutHoles(
|
|
18
|
-
function _slicedToArray(
|
|
16
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
17
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
18
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
19
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
-
function _unsupportedIterableToArray(
|
|
21
|
-
function _arrayLikeToArray(
|
|
20
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
+
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; }
|
|
22
22
|
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; } }
|
|
23
|
-
function _arrayWithHoles(
|
|
24
|
-
function _classCallCheck(
|
|
25
|
-
function _defineProperties(
|
|
26
|
-
function _createClass(
|
|
23
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
24
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
25
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
26
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
27
27
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
function _possibleConstructorReturn(
|
|
28
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
29
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
29
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
30
|
-
function _getPrototypeOf(
|
|
31
|
-
function
|
|
32
|
-
function
|
|
33
|
-
function
|
|
34
|
-
function
|
|
35
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
31
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
32
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
33
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
34
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
35
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
36
36
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
37
37
|
var propTypes = {
|
|
38
38
|
clickable: _propTypes.PropTypes.bool,
|
|
@@ -55,12 +55,11 @@ var defaultProps = {
|
|
|
55
55
|
shortcuts: []
|
|
56
56
|
};
|
|
57
57
|
var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
58
|
-
_inherits(Shortcut, _Component);
|
|
59
58
|
function Shortcut(props, context) {
|
|
60
59
|
var _this;
|
|
61
60
|
_classCallCheck(this, Shortcut);
|
|
62
61
|
_this = _callSuper(this, Shortcut, [props, context]);
|
|
63
|
-
_defineProperty(
|
|
62
|
+
_defineProperty(_this, "segmentShift", function (direction) {
|
|
64
63
|
var _this$props = _this.props,
|
|
65
64
|
leftMarker = _this$props.playerSelectedMarker.leftMarker,
|
|
66
65
|
onTagClick = _this$props.onTagClick;
|
|
@@ -85,22 +84,33 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
85
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]);
|
|
86
85
|
}
|
|
87
86
|
});
|
|
88
|
-
_defineProperty(
|
|
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
|
+
});
|
|
98
|
+
_defineProperty(_this, "debounceSegmentShiftForward", (0, _lodash.debounce)(function () {
|
|
89
99
|
_this.segmentShift('forward');
|
|
90
100
|
}, 0));
|
|
91
|
-
_defineProperty(
|
|
101
|
+
_defineProperty(_this, "debounceSegmentShiftBackward", (0, _lodash.debounce)(function () {
|
|
92
102
|
_this.segmentShift('backward');
|
|
93
103
|
}, 0));
|
|
94
|
-
_defineProperty(
|
|
104
|
+
_defineProperty(_this, "debounceKeyFunc", (0, _lodash.debounce)(function (keyCode) {
|
|
95
105
|
_this.handleKeyMovement(keyCode);
|
|
96
106
|
}));
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* @param {number} keyCode the keycode for the specific key's functionality
|
|
100
|
-
* @param {boolean} currentTimeRequired currentTime value required or not to perform key functionality
|
|
101
|
-
*common function to handle the key functionalies. eg-> W Key and Q key functionalities
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* @param {number} keyCode the keycode for the specific key's functionality
|
|
110
|
+
* @param {boolean} currentTimeRequired currentTime value required or not to perform key functionality
|
|
111
|
+
*common function to handle the key functionalies. eg-> W Key and Q key functionalities
|
|
102
112
|
*/
|
|
103
|
-
_defineProperty(
|
|
113
|
+
_defineProperty(_this, "handleKeyMovement", function (keyCode) {
|
|
104
114
|
var _this$props$markers$, _this$props$playerSel, _this$props$player, _this$props$player2;
|
|
105
115
|
if (keyCode === 81 || keyCode === 87) {
|
|
106
116
|
_this.isCalled = true;
|
|
@@ -123,16 +133,16 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
123
133
|
});
|
|
124
134
|
}
|
|
125
135
|
});
|
|
126
|
-
/**
|
|
127
|
-
*
|
|
128
|
-
* @param {event} event
|
|
129
|
-
* @param {function} handleKeyMovement function to call Q and W key functionality
|
|
130
|
-
* @param {function} debounceKeyFunc to handle the debounced I and O key functionality
|
|
131
|
-
* @param {string} keyParameter to identify the key combo pressed
|
|
132
|
-
* this function executed the Q and W key functionality first and then performs I and O key functionality provided 3 key combo is still pressed
|
|
133
|
-
* 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.
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param {event} event
|
|
139
|
+
* @param {function} handleKeyMovement function to call Q and W key functionality
|
|
140
|
+
* @param {function} debounceKeyFunc to handle the debounced I and O key functionality
|
|
141
|
+
* @param {string} keyParameter to identify the key combo pressed
|
|
142
|
+
* this function executed the Q and W key functionality first and then performs I and O key functionality provided 3 key combo is still pressed
|
|
143
|
+
* 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.
|
|
134
144
|
*/
|
|
135
|
-
_defineProperty(
|
|
145
|
+
_defineProperty(_this, "createThreeKeyCombo", function (event, handleKeyMovement, debounceKeyFunc, keyParameter) {
|
|
136
146
|
var _this$props3 = _this.props,
|
|
137
147
|
playerReadOnlyMode = _this$props3.playerReadOnlyMode,
|
|
138
148
|
disablePlayerActions = _this$props3.disablePlayerActions;
|
|
@@ -150,26 +160,26 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
150
160
|
_this.isCalled = false;
|
|
151
161
|
}
|
|
152
162
|
});
|
|
153
|
-
_defineProperty(
|
|
154
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(
|
|
163
|
+
_defineProperty(_this, "threeKeyCombo1", (0, _lodash.debounce)(function (event) {
|
|
164
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 87), _this.debounceKeyFunc.bind(_this, 79), 'Ctrl + O + Right');
|
|
155
165
|
}, 0, {
|
|
156
166
|
leading: true,
|
|
157
167
|
trailing: true
|
|
158
168
|
}));
|
|
159
|
-
_defineProperty(
|
|
160
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(
|
|
169
|
+
_defineProperty(_this, "threeKeyCombo2", (0, _lodash.debounce)(function (event) {
|
|
170
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 87), _this.debounceKeyFunc.bind(_this, 79), 'Ctrl + O + Left');
|
|
161
171
|
}, 0, {
|
|
162
172
|
leading: true,
|
|
163
173
|
trailing: true
|
|
164
174
|
}));
|
|
165
|
-
_defineProperty(
|
|
166
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(
|
|
175
|
+
_defineProperty(_this, "threeKeyCombo3", (0, _lodash.debounce)(function (event) {
|
|
176
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 81), _this.debounceKeyFunc.bind(_this, 73), 'Ctrl + I + Right');
|
|
167
177
|
}, 0, {
|
|
168
178
|
leading: true,
|
|
169
179
|
trailing: true
|
|
170
180
|
}));
|
|
171
|
-
_defineProperty(
|
|
172
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(
|
|
181
|
+
_defineProperty(_this, "threeKeyCombo4", (0, _lodash.debounce)(function (event) {
|
|
182
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 81), _this.debounceKeyFunc.bind(_this, 73), 'Ctrl + I + Left');
|
|
173
183
|
}, 0, {
|
|
174
184
|
leading: true,
|
|
175
185
|
trailing: true
|
|
@@ -305,8 +315,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
305
315
|
return;
|
|
306
316
|
}
|
|
307
317
|
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
308
|
-
for (var
|
|
309
|
-
args[
|
|
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];
|
|
310
320
|
}
|
|
311
321
|
var isOverLapTime = args[0].timeAfterOverlap;
|
|
312
322
|
if (isOverLapTime) {
|
|
@@ -374,13 +384,19 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
374
384
|
playerReadOnlyMode = _this$props5.playerReadOnlyMode,
|
|
375
385
|
disablePlayerActions = _this$props5.disablePlayerActions,
|
|
376
386
|
playerSelectedMarker = _this$props5.playerSelectedMarker,
|
|
377
|
-
frameRate = _this$props5.frameRate
|
|
387
|
+
frameRate = _this$props5.frameRate,
|
|
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
|
+
}
|
|
378
394
|
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
379
395
|
return;
|
|
380
396
|
}
|
|
381
397
|
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
382
|
-
for (var
|
|
383
|
-
args[
|
|
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];
|
|
384
400
|
}
|
|
385
401
|
var isOverLapTime = args[0].timeAfterOverlap;
|
|
386
402
|
if (isOverLapTime) {
|
|
@@ -450,8 +466,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
450
466
|
actions.seek(player.currentTime);
|
|
451
467
|
}
|
|
452
468
|
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
453
|
-
for (var
|
|
454
|
-
args[
|
|
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];
|
|
455
471
|
}
|
|
456
472
|
var isOverLapTime = args[0].timeAfterOverlap;
|
|
457
473
|
if (isOverLapTime) {
|
|
@@ -610,13 +626,14 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
610
626
|
}];
|
|
611
627
|
_this.shortcuts = _toConsumableArray(_this.defaultShortcuts);
|
|
612
628
|
_this.isCalled = false;
|
|
613
|
-
_this.mergeShortcuts = _this.mergeShortcuts.bind(
|
|
614
|
-
_this.handleKeyPress = _this.handleKeyPress.bind(
|
|
615
|
-
_this.handleClick = _this.handleClick.bind(
|
|
616
|
-
_this.handleDoubleClick = _this.handleDoubleClick.bind(
|
|
629
|
+
_this.mergeShortcuts = _this.mergeShortcuts.bind(_this);
|
|
630
|
+
_this.handleKeyPress = _this.handleKeyPress.bind(_this);
|
|
631
|
+
_this.handleClick = _this.handleClick.bind(_this);
|
|
632
|
+
_this.handleDoubleClick = _this.handleDoubleClick.bind(_this);
|
|
617
633
|
return _this;
|
|
618
634
|
}
|
|
619
|
-
|
|
635
|
+
_inherits(Shortcut, _Component);
|
|
636
|
+
return _createClass(Shortcut, [{
|
|
620
637
|
key: "componentDidMount",
|
|
621
638
|
value: function componentDidMount() {
|
|
622
639
|
this.mergeShortcuts();
|
|
@@ -791,20 +808,20 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
791
808
|
} else if (playbackRate >= 0.5) {
|
|
792
809
|
playbackRate = 1.0;
|
|
793
810
|
}
|
|
794
|
-
/*
|
|
795
|
-
* else if (playbackRate >= 1.25) {
|
|
796
|
-
* playbackRate = 1.5;
|
|
797
|
-
* } else if (playbackRate >= 1.0) {
|
|
798
|
-
* playbackRate = 1.25;
|
|
799
|
-
* }
|
|
800
|
-
* else if (playbackRate >= 0.5) {
|
|
801
|
-
* playbackRate = 1.0;
|
|
802
|
-
* }
|
|
803
|
-
* else if (playbackRate >= 0.25) {
|
|
804
|
-
* playbackRate = 0.5;
|
|
805
|
-
* } else if (playbackRate >= 0) {
|
|
806
|
-
* playbackRate = 0.25;
|
|
807
|
-
* }
|
|
811
|
+
/*
|
|
812
|
+
* else if (playbackRate >= 1.25) {
|
|
813
|
+
* playbackRate = 1.5;
|
|
814
|
+
* } else if (playbackRate >= 1.0) {
|
|
815
|
+
* playbackRate = 1.25;
|
|
816
|
+
* }
|
|
817
|
+
* else if (playbackRate >= 0.5) {
|
|
818
|
+
* playbackRate = 1.0;
|
|
819
|
+
* }
|
|
820
|
+
* else if (playbackRate >= 0.25) {
|
|
821
|
+
* playbackRate = 0.5;
|
|
822
|
+
* } else if (playbackRate >= 0) {
|
|
823
|
+
* playbackRate = 0.25;
|
|
824
|
+
* }
|
|
808
825
|
*/
|
|
809
826
|
actions.changeRate(playbackRate, {
|
|
810
827
|
action: 'fast-forward',
|
|
@@ -847,8 +864,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
847
864
|
return true;
|
|
848
865
|
})[0];
|
|
849
866
|
if (shortcut) {
|
|
850
|
-
var _markers
|
|
851
|
-
shortcut.handle(player, actions, frameRate, e, (_markers$ = markers[0]) === null || _markers$ === void 0 ? void 0 : _markers
|
|
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);
|
|
852
869
|
e.preventDefault();
|
|
853
870
|
}
|
|
854
871
|
}
|
|
@@ -889,9 +906,9 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
889
906
|
// e.preventDefault();
|
|
890
907
|
}
|
|
891
908
|
|
|
892
|
-
/*
|
|
893
|
-
* this component dose not render anything
|
|
894
|
-
* it's just for the key down event
|
|
909
|
+
/*
|
|
910
|
+
* this component dose not render anything
|
|
911
|
+
* it's just for the key down event
|
|
895
912
|
*/
|
|
896
913
|
}, {
|
|
897
914
|
key: "render",
|
|
@@ -899,7 +916,6 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
899
916
|
return null;
|
|
900
917
|
}
|
|
901
918
|
}]);
|
|
902
|
-
return Shortcut;
|
|
903
919
|
}(_react.Component);
|
|
904
920
|
Shortcut.propTypes = propTypes;
|
|
905
921
|
Shortcut.defaultProps = defaultProps;
|
package/components/Slider.js
CHANGED
|
@@ -12,22 +12,23 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var Dom = _interopRequireWildcard(require("../utils/dom"));
|
|
13
13
|
var _tokens = require("@desynova-digital/tokens");
|
|
14
14
|
var _templateObject;
|
|
15
|
-
function _interopRequireDefault(
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
16
|
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); }
|
|
17
|
-
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 &&
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
21
|
-
function
|
|
17
|
+
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; }
|
|
18
|
+
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
23
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
24
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24
|
-
function _possibleConstructorReturn(
|
|
25
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
26
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
25
27
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
|
-
function _getPrototypeOf(
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
28
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
29
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
30
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
31
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
31
32
|
var propTypes = {
|
|
32
33
|
theme: _propTypes.PropTypes.string,
|
|
33
34
|
onMouseDown: _propTypes.PropTypes.func,
|
|
@@ -69,29 +70,29 @@ var SliderBlock = _styledComponents["default"].div(_templateObject || (_template
|
|
|
69
70
|
return props.theme ? " ".concat(_tokens.colors[props.theme].base) : '#121d29';
|
|
70
71
|
});
|
|
71
72
|
var Slider = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
72
|
-
_inherits(Slider, _Component);
|
|
73
73
|
function Slider(props, context) {
|
|
74
74
|
var _this;
|
|
75
75
|
_classCallCheck(this, Slider);
|
|
76
76
|
_this = _callSuper(this, Slider, [props, context]);
|
|
77
|
-
_this.handleMouseDown = _this.handleMouseDown.bind(
|
|
78
|
-
_this.handleMouseMove = _this.handleMouseMove.bind(
|
|
79
|
-
_this.handleMouseUp = _this.handleMouseUp.bind(
|
|
80
|
-
_this.handleFocus = _this.handleFocus.bind(
|
|
81
|
-
_this.handleBlur = _this.handleBlur.bind(
|
|
82
|
-
_this.handleClick = _this.handleClick.bind(
|
|
83
|
-
_this.handleKeyPress = _this.handleKeyPress.bind(
|
|
84
|
-
_this.stepForward = _this.stepForward.bind(
|
|
85
|
-
_this.stepBack = _this.stepBack.bind(
|
|
86
|
-
_this.calculateDistance = _this.calculateDistance.bind(
|
|
87
|
-
_this.getProgress = _this.getProgress.bind(
|
|
88
|
-
_this.renderChildren = _this.renderChildren.bind(
|
|
77
|
+
_this.handleMouseDown = _this.handleMouseDown.bind(_this);
|
|
78
|
+
_this.handleMouseMove = _this.handleMouseMove.bind(_this);
|
|
79
|
+
_this.handleMouseUp = _this.handleMouseUp.bind(_this);
|
|
80
|
+
_this.handleFocus = _this.handleFocus.bind(_this);
|
|
81
|
+
_this.handleBlur = _this.handleBlur.bind(_this);
|
|
82
|
+
_this.handleClick = _this.handleClick.bind(_this);
|
|
83
|
+
_this.handleKeyPress = _this.handleKeyPress.bind(_this);
|
|
84
|
+
_this.stepForward = _this.stepForward.bind(_this);
|
|
85
|
+
_this.stepBack = _this.stepBack.bind(_this);
|
|
86
|
+
_this.calculateDistance = _this.calculateDistance.bind(_this);
|
|
87
|
+
_this.getProgress = _this.getProgress.bind(_this);
|
|
88
|
+
_this.renderChildren = _this.renderChildren.bind(_this);
|
|
89
89
|
_this.state = {
|
|
90
90
|
// active: false,
|
|
91
91
|
};
|
|
92
92
|
return _this;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
_inherits(Slider, _Component);
|
|
95
|
+
return _createClass(Slider, [{
|
|
95
96
|
key: "getProgress",
|
|
96
97
|
value: function getProgress() {
|
|
97
98
|
var getPercent = this.props.getPercent;
|
|
@@ -112,9 +113,9 @@ var Slider = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
112
113
|
var _this$props = this.props,
|
|
113
114
|
onMouseDown = _this$props.onMouseDown,
|
|
114
115
|
sliderActive = _this$props.sliderActive;
|
|
115
|
-
/*
|
|
116
|
-
* event.preventDefault();
|
|
117
|
-
* event.stopPropagation();
|
|
116
|
+
/*
|
|
117
|
+
* event.preventDefault();
|
|
118
|
+
* event.stopPropagation();
|
|
118
119
|
*/
|
|
119
120
|
|
|
120
121
|
document.addEventListener('mousemove', this.handleMouseMove, true);
|
|
@@ -122,9 +123,9 @@ var Slider = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
122
123
|
document.addEventListener('touchmove', this.handleMouseMove, true);
|
|
123
124
|
document.addEventListener('touchend', this.handleMouseUp, true);
|
|
124
125
|
this.setState({
|
|
125
|
-
/*
|
|
126
|
-
* active: true,
|
|
127
|
-
* distance: 0
|
|
126
|
+
/*
|
|
127
|
+
* active: true,
|
|
128
|
+
* distance: 0
|
|
128
129
|
*/
|
|
129
130
|
});
|
|
130
131
|
if (sliderActive) {
|
|
@@ -271,7 +272,6 @@ var Slider = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
271
272
|
}, this.renderChildren());
|
|
272
273
|
}
|
|
273
274
|
}]);
|
|
274
|
-
return Slider;
|
|
275
275
|
}(_react.Component);
|
|
276
276
|
Slider.propTypes = propTypes;
|
|
277
277
|
Slider.defaultProps = defaultProps;
|
package/components/TagsBar.js
CHANGED
|
@@ -9,22 +9,22 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = require("prop-types");
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
var _templateObject;
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
13
|
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); }
|
|
14
|
-
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 &&
|
|
15
|
-
function _classCallCheck(
|
|
16
|
-
function _defineProperties(
|
|
17
|
-
function _createClass(
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i :
|
|
14
|
+
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; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
20
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
21
|
-
function _possibleConstructorReturn(
|
|
21
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
22
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
22
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
|
-
function _getPrototypeOf(
|
|
24
|
-
function
|
|
25
|
-
function
|
|
26
|
-
function
|
|
27
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
24
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
25
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
26
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
27
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
28
28
|
var propTypes = {
|
|
29
29
|
tagsMarker: _propTypes.PropTypes.instanceOf(Array),
|
|
30
30
|
player: _propTypes.PropTypes.instanceOf(Object),
|
|
@@ -32,15 +32,15 @@ var propTypes = {
|
|
|
32
32
|
};
|
|
33
33
|
var TagsBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 10px;\n position: absolute;\n bottom: 40px;\n cursor: default;\n .marker {\n position: absolute;\n width: 2px;\n height: 100%;\n background: #00cec6;\n cursor: pointer;\n transition: transform 250ms ease-in-out;\n &:hover {\n transform: scale(2);\n }\n }\n"])));
|
|
34
34
|
var TagsBar = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
35
|
-
_inherits(TagsBar, _Component);
|
|
36
35
|
function TagsBar(props) {
|
|
37
36
|
var _this;
|
|
38
37
|
_classCallCheck(this, TagsBar);
|
|
39
38
|
_this = _callSuper(this, TagsBar, [props]);
|
|
40
|
-
_this.getMarkerPosition = _this.getMarkerPosition.bind(
|
|
39
|
+
_this.getMarkerPosition = _this.getMarkerPosition.bind(_this);
|
|
41
40
|
return _this;
|
|
42
41
|
}
|
|
43
|
-
|
|
42
|
+
_inherits(TagsBar, _Component);
|
|
43
|
+
return _createClass(TagsBar, [{
|
|
44
44
|
key: "getMarkerPosition",
|
|
45
45
|
value: function getMarkerPosition(timePos) {
|
|
46
46
|
var player = this.props.player;
|
|
@@ -75,7 +75,6 @@ var TagsBar = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
75
75
|
}));
|
|
76
76
|
}
|
|
77
77
|
}]);
|
|
78
|
-
return TagsBar;
|
|
79
78
|
}(_react.Component);
|
|
80
79
|
TagsBar.propTypes = propTypes;
|
|
81
80
|
TagsBar.displayName = 'TagsBar';
|