@desynova-digital/player 4.0.39 → 4.0.40
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 +9 -8
- package/actions/player.js +1 -1
- package/components/AudioMeter.js +28 -27
- package/components/BigPlayButton.js +17 -16
- package/components/ImageViewer.js +17 -16
- package/components/MarkerBar.js +17 -16
- package/components/Menu.js +2 -2
- package/components/Player.js +46 -45
- package/components/PlayerHeader.js +24 -23
- package/components/Playlist.js +15 -14
- package/components/PointersBar.js +20 -19
- package/components/PosterImage.js +1 -1
- package/components/SDOutline.js +2 -2
- package/components/Shortcut.js +161 -98
- package/components/Slider.js +33 -33
- package/components/TagsBar.js +16 -15
- package/components/Video.js +112 -111
- package/components/control-bar/AudioTracksMenuButton.js +15 -14
- package/components/control-bar/CameraButton.js +16 -15
- package/components/control-bar/CaptionControlMenuButton.js +20 -19
- package/components/control-bar/CommentsButton.js +17 -16
- package/components/control-bar/ControlBar.js +18 -17
- package/components/control-bar/EditorControlMenuButton.js +17 -16
- package/components/control-bar/ForwardControl.js +1 -1
- package/components/control-bar/ForwardReplayControl.js +16 -15
- package/components/control-bar/FullscreenToggle.js +16 -15
- package/components/control-bar/PlayToggle.js +16 -15
- package/components/control-bar/ReplayControl.js +1 -1
- package/components/control-bar/SettingsMenuButton.js +4 -4
- package/components/control-bar/SubtitleLanguagesMenuButton.js +15 -14
- package/components/control-bar/SubtitleMovementMenu.js +17 -16
- package/components/control-bar/VolumeMenuButton.js +17 -16
- package/components/control-bar/ZoomMenuButton.js +17 -16
- package/components/marking-controls/MarkInControl.js +16 -15
- package/components/marking-controls/MarkOutControl.js +16 -15
- package/components/marking-controls/MarkingAddButton.js +16 -15
- package/components/marking-controls/MarkingControl.js +2 -2
- package/components/marking-controls/MarkingDeleteButton.js +16 -15
- package/components/marking-controls/MarkingDuration.js +2 -2
- package/components/marking-controls/MarkingPreview.js +16 -15
- package/components/progress-bar/AudioWaveform.js +16 -15
- 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 +20 -19
- package/components/progress-bar/SeekBar.js +28 -27
- package/components/progress-bar/Timeline.js +16 -15
- package/components/settings-menu-control/CameraControl.js +3 -3
- package/components/settings-menu-control/ChildMenuComponent.js +29 -28
- package/components/settings-menu-control/ParentMenuComponent.js +18 -17
- package/components/settings-menu-control/PlaybackRateControl.js +16 -15
- package/components/settings-menu-control/SafeAreaControl.js +16 -15
- 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 +25 -24
- package/components/volume-control/VolumeControl.js +1 -1
- package/components/volume-control/VolumeLevel.js +2 -2
- package/components/zoom-control/ZoomBar.js +24 -23
- 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 +6 -5
- 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(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _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(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
17
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
18
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
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(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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(
|
|
29
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
28
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
30
29
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
-
function _getPrototypeOf(
|
|
32
|
-
function
|
|
33
|
-
function
|
|
34
|
-
function
|
|
35
|
-
function
|
|
30
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
31
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
34
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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,11 +55,12 @@ var defaultProps = {
|
|
|
55
55
|
shortcuts: []
|
|
56
56
|
};
|
|
57
57
|
var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
58
|
+
_inherits(Shortcut, _Component);
|
|
58
59
|
function Shortcut(props, context) {
|
|
59
60
|
var _this;
|
|
60
61
|
_classCallCheck(this, Shortcut);
|
|
61
62
|
_this = _callSuper(this, Shortcut, [props, context]);
|
|
62
|
-
_defineProperty(_this, "segmentShift", function (direction) {
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "segmentShift", function (direction) {
|
|
63
64
|
var _this$props = _this.props,
|
|
64
65
|
leftMarker = _this$props.playerSelectedMarker.leftMarker,
|
|
65
66
|
onTagClick = _this$props.onTagClick;
|
|
@@ -84,22 +85,22 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
84
85
|
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
86
|
}
|
|
86
87
|
});
|
|
87
|
-
_defineProperty(_this, "debounceSegmentShiftForward", (0, _lodash.debounce)(function () {
|
|
88
|
+
_defineProperty(_assertThisInitialized(_this), "debounceSegmentShiftForward", (0, _lodash.debounce)(function () {
|
|
88
89
|
_this.segmentShift('forward');
|
|
89
90
|
}, 0));
|
|
90
|
-
_defineProperty(_this, "debounceSegmentShiftBackward", (0, _lodash.debounce)(function () {
|
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "debounceSegmentShiftBackward", (0, _lodash.debounce)(function () {
|
|
91
92
|
_this.segmentShift('backward');
|
|
92
93
|
}, 0));
|
|
93
|
-
_defineProperty(_this, "debounceKeyFunc", (0, _lodash.debounce)(function (keyCode) {
|
|
94
|
+
_defineProperty(_assertThisInitialized(_this), "debounceKeyFunc", (0, _lodash.debounce)(function (keyCode) {
|
|
94
95
|
_this.handleKeyMovement(keyCode);
|
|
95
96
|
}));
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
* @param {number} keyCode the keycode for the specific key's functionality
|
|
99
|
-
* @param {boolean} currentTimeRequired currentTime value required or not to perform key functionality
|
|
100
|
-
*common function to handle the key functionalies. eg-> W Key and Q key functionalities
|
|
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
|
|
101
102
|
*/
|
|
102
|
-
_defineProperty(_this, "handleKeyMovement", function (keyCode) {
|
|
103
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyMovement", function (keyCode) {
|
|
103
104
|
var _this$props$markers$, _this$props$playerSel, _this$props$player, _this$props$player2;
|
|
104
105
|
if (keyCode === 81 || keyCode === 87) {
|
|
105
106
|
_this.isCalled = true;
|
|
@@ -122,16 +123,16 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
122
123
|
});
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
|
-
/**
|
|
126
|
-
*
|
|
127
|
-
* @param {event} event
|
|
128
|
-
* @param {function} handleKeyMovement function to call Q and W key functionality
|
|
129
|
-
* @param {function} debounceKeyFunc to handle the debounced I and O key functionality
|
|
130
|
-
* @param {string} keyParameter to identify the key combo pressed
|
|
131
|
-
* 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
|
|
132
|
-
* 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.
|
|
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.
|
|
133
134
|
*/
|
|
134
|
-
_defineProperty(_this, "createThreeKeyCombo", function (event, handleKeyMovement, debounceKeyFunc, keyParameter) {
|
|
135
|
+
_defineProperty(_assertThisInitialized(_this), "createThreeKeyCombo", function (event, handleKeyMovement, debounceKeyFunc, keyParameter) {
|
|
135
136
|
var _this$props3 = _this.props,
|
|
136
137
|
playerReadOnlyMode = _this$props3.playerReadOnlyMode,
|
|
137
138
|
disablePlayerActions = _this$props3.disablePlayerActions;
|
|
@@ -149,26 +150,26 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
149
150
|
_this.isCalled = false;
|
|
150
151
|
}
|
|
151
152
|
});
|
|
152
|
-
_defineProperty(_this, "threeKeyCombo1", (0, _lodash.debounce)(function (event) {
|
|
153
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 87), _this.debounceKeyFunc.bind(_this, 79), 'Ctrl + O + Right');
|
|
153
|
+
_defineProperty(_assertThisInitialized(_this), "threeKeyCombo1", (0, _lodash.debounce)(function (event) {
|
|
154
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_assertThisInitialized(_this), 87), _this.debounceKeyFunc.bind(_assertThisInitialized(_this), 79), 'Ctrl + O + Right');
|
|
154
155
|
}, 0, {
|
|
155
156
|
leading: true,
|
|
156
157
|
trailing: true
|
|
157
158
|
}));
|
|
158
|
-
_defineProperty(_this, "threeKeyCombo2", (0, _lodash.debounce)(function (event) {
|
|
159
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 87), _this.debounceKeyFunc.bind(_this, 79), 'Ctrl + O + Left');
|
|
159
|
+
_defineProperty(_assertThisInitialized(_this), "threeKeyCombo2", (0, _lodash.debounce)(function (event) {
|
|
160
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_assertThisInitialized(_this), 87), _this.debounceKeyFunc.bind(_assertThisInitialized(_this), 79), 'Ctrl + O + Left');
|
|
160
161
|
}, 0, {
|
|
161
162
|
leading: true,
|
|
162
163
|
trailing: true
|
|
163
164
|
}));
|
|
164
|
-
_defineProperty(_this, "threeKeyCombo3", (0, _lodash.debounce)(function (event) {
|
|
165
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 81), _this.debounceKeyFunc.bind(_this, 73), 'Ctrl + I + Right');
|
|
165
|
+
_defineProperty(_assertThisInitialized(_this), "threeKeyCombo3", (0, _lodash.debounce)(function (event) {
|
|
166
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_assertThisInitialized(_this), 81), _this.debounceKeyFunc.bind(_assertThisInitialized(_this), 73), 'Ctrl + I + Right');
|
|
166
167
|
}, 0, {
|
|
167
168
|
leading: true,
|
|
168
169
|
trailing: true
|
|
169
170
|
}));
|
|
170
|
-
_defineProperty(_this, "threeKeyCombo4", (0, _lodash.debounce)(function (event) {
|
|
171
|
-
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_this, 81), _this.debounceKeyFunc.bind(_this, 73), 'Ctrl + I + Left');
|
|
171
|
+
_defineProperty(_assertThisInitialized(_this), "threeKeyCombo4", (0, _lodash.debounce)(function (event) {
|
|
172
|
+
return _this.createThreeKeyCombo(event, _this.handleKeyMovement.bind(_assertThisInitialized(_this), 81), _this.debounceKeyFunc.bind(_assertThisInitialized(_this), 73), 'Ctrl + I + Left');
|
|
172
173
|
}, 0, {
|
|
173
174
|
leading: true,
|
|
174
175
|
trailing: true
|
|
@@ -286,8 +287,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
286
287
|
actions.seek(0); // Go to beginning of video
|
|
287
288
|
}
|
|
288
289
|
}, {
|
|
289
|
-
keyCode:
|
|
290
|
-
//
|
|
290
|
+
keyCode: 67,
|
|
291
|
+
// C Key
|
|
291
292
|
handle: function handle(player, actions) {
|
|
292
293
|
var _this$props4 = _this.props,
|
|
293
294
|
markers = _this$props4.markers,
|
|
@@ -363,19 +364,81 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
363
364
|
}
|
|
364
365
|
}
|
|
365
366
|
}, {
|
|
366
|
-
keyCode:
|
|
367
|
-
//
|
|
367
|
+
keyCode: 73,
|
|
368
|
+
// I Key
|
|
368
369
|
handle: function handle(player, actions) {
|
|
369
370
|
var _this$props5 = _this.props,
|
|
370
371
|
markers = _this$props5.markers,
|
|
371
|
-
onMarkerSelect = _this$props5.onMarkerSelect,
|
|
372
372
|
playerType = _this$props5.playerType,
|
|
373
373
|
onAddMarker = _this$props5.onAddMarker,
|
|
374
374
|
playerReadOnlyMode = _this$props5.playerReadOnlyMode,
|
|
375
375
|
disablePlayerActions = _this$props5.disablePlayerActions,
|
|
376
376
|
playerSelectedMarker = _this$props5.playerSelectedMarker,
|
|
377
|
-
frameRate = _this$props5.frameRate
|
|
378
|
-
|
|
377
|
+
frameRate = _this$props5.frameRate;
|
|
378
|
+
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
382
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
383
|
+
args[_key2 - 2] = arguments[_key2];
|
|
384
|
+
}
|
|
385
|
+
var isOverLapTime = args[0].timeAfterOverlap;
|
|
386
|
+
if (isOverLapTime) {
|
|
387
|
+
onAddMarker(args[0].timeAfterOverlap, playerSelectedMarker.rightMarker, 'update');
|
|
388
|
+
} else {
|
|
389
|
+
if (playerType !== 'panel') {
|
|
390
|
+
var createPoint = true;
|
|
391
|
+
if (markers && markers.length && markers[0].values && markers[0].values.length) {
|
|
392
|
+
var markerArr = markers[0].values;
|
|
393
|
+
if (Object.keys(player.selectedMarker).length) {
|
|
394
|
+
markerArr = markerArr.filter(function (marker) {
|
|
395
|
+
return marker.start_time !== player.selectedMarker.leftMarker && marker.end_time !== player.selectedMarker.rightMarker;
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
markerArr.filter(function (marker) {
|
|
399
|
+
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) {
|
|
400
|
+
createPoint = false;
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
if (!createPoint && playerSelectedMarker.markerType === 'update' && currentAdjustedTime > player.selectedMarker.leftMarker && currentAdjustedTime < player.selectedMarker.rightMarker) {
|
|
405
|
+
createPoint = true;
|
|
406
|
+
}
|
|
407
|
+
if (createPoint) {
|
|
408
|
+
if (playerSelectedMarker.rightMarker < 0 || playerSelectedMarker.rightMarker > -1 && currentAdjustedTime < playerSelectedMarker.rightMarker) {
|
|
409
|
+
// actions.handleMarkerPointChange(
|
|
410
|
+
// player.markerType !== 'update' ? 'add' : 'update',
|
|
411
|
+
// 'left',
|
|
412
|
+
// currentAdjustedTime
|
|
413
|
+
// );
|
|
414
|
+
var data = {
|
|
415
|
+
markerType: playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length ? 'update' : 'add',
|
|
416
|
+
markerPos: 'left',
|
|
417
|
+
currentTime: currentAdjustedTime
|
|
418
|
+
};
|
|
419
|
+
onAddMarker(currentAdjustedTime, -1, '', true, data);
|
|
420
|
+
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length)) {
|
|
421
|
+
onAddMarker(currentAdjustedTime, playerSelectedMarker.rightMarker, 'update');
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}, {
|
|
429
|
+
keyCode: 79,
|
|
430
|
+
// O Key
|
|
431
|
+
handle: function handle(player, actions) {
|
|
432
|
+
var _this$props6 = _this.props,
|
|
433
|
+
markers = _this$props6.markers,
|
|
434
|
+
onMarkerSelect = _this$props6.onMarkerSelect,
|
|
435
|
+
playerType = _this$props6.playerType,
|
|
436
|
+
onAddMarker = _this$props6.onAddMarker,
|
|
437
|
+
playerReadOnlyMode = _this$props6.playerReadOnlyMode,
|
|
438
|
+
disablePlayerActions = _this$props6.disablePlayerActions,
|
|
439
|
+
playerSelectedMarker = _this$props6.playerSelectedMarker,
|
|
440
|
+
frameRate = _this$props6.frameRate,
|
|
441
|
+
pauseOnOutMarkerSelect = _this$props6.pauseOnOutMarkerSelect;
|
|
379
442
|
if (playerReadOnlyMode || disablePlayerActions.includes('marking_controls')) {
|
|
380
443
|
return;
|
|
381
444
|
}
|
|
@@ -387,8 +450,8 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
387
450
|
actions.seek(player.currentTime);
|
|
388
451
|
}
|
|
389
452
|
var currentAdjustedTime = (0, _utils.handleAdjustingVideoAsPerFrame)(player.currentTime, frameRate);
|
|
390
|
-
for (var
|
|
391
|
-
args[
|
|
453
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
|
454
|
+
args[_key3 - 2] = arguments[_key3];
|
|
392
455
|
}
|
|
393
456
|
var isOverLapTime = args[0].timeAfterOverlap;
|
|
394
457
|
if (isOverLapTime) {
|
|
@@ -547,14 +610,13 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
547
610
|
}];
|
|
548
611
|
_this.shortcuts = _toConsumableArray(_this.defaultShortcuts);
|
|
549
612
|
_this.isCalled = false;
|
|
550
|
-
_this.mergeShortcuts = _this.mergeShortcuts.bind(_this);
|
|
551
|
-
_this.handleKeyPress = _this.handleKeyPress.bind(_this);
|
|
552
|
-
_this.handleClick = _this.handleClick.bind(_this);
|
|
553
|
-
_this.handleDoubleClick = _this.handleDoubleClick.bind(_this);
|
|
613
|
+
_this.mergeShortcuts = _this.mergeShortcuts.bind(_assertThisInitialized(_this));
|
|
614
|
+
_this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));
|
|
615
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
616
|
+
_this.handleDoubleClick = _this.handleDoubleClick.bind(_assertThisInitialized(_this));
|
|
554
617
|
return _this;
|
|
555
618
|
}
|
|
556
|
-
|
|
557
|
-
return _createClass(Shortcut, [{
|
|
619
|
+
_createClass(Shortcut, [{
|
|
558
620
|
key: "componentDidMount",
|
|
559
621
|
value: function componentDidMount() {
|
|
560
622
|
this.mergeShortcuts();
|
|
@@ -601,10 +663,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
601
663
|
}, {
|
|
602
664
|
key: "componentDidUpdate",
|
|
603
665
|
value: function componentDidUpdate(prevProps) {
|
|
604
|
-
var _this$
|
|
605
|
-
shortcuts = _this$
|
|
606
|
-
player = _this$
|
|
607
|
-
frameRate = _this$
|
|
666
|
+
var _this$props7 = this.props,
|
|
667
|
+
shortcuts = _this$props7.shortcuts,
|
|
668
|
+
player = _this$props7.player,
|
|
669
|
+
frameRate = _this$props7.frameRate;
|
|
608
670
|
if (prevProps.shortcuts !== shortcuts) {
|
|
609
671
|
this.mergeShortcuts();
|
|
610
672
|
}
|
|
@@ -628,10 +690,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
628
690
|
}, {
|
|
629
691
|
key: "rewindVideo",
|
|
630
692
|
value: function rewindVideo() {
|
|
631
|
-
var _this$
|
|
632
|
-
player = _this$
|
|
633
|
-
actions = _this$
|
|
634
|
-
frameRate = _this$
|
|
693
|
+
var _this$props8 = this.props,
|
|
694
|
+
player = _this$props8.player,
|
|
695
|
+
actions = _this$props8.actions,
|
|
696
|
+
frameRate = _this$props8.frameRate;
|
|
635
697
|
if (player.currentTime == 0 || !player.rewindActive) {
|
|
636
698
|
clearInterval(this.intervalRewind);
|
|
637
699
|
this.intervalRewind = null;
|
|
@@ -729,20 +791,20 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
729
791
|
} else if (playbackRate >= 0.5) {
|
|
730
792
|
playbackRate = 1.0;
|
|
731
793
|
}
|
|
732
|
-
/*
|
|
733
|
-
* else if (playbackRate >= 1.25) {
|
|
734
|
-
* playbackRate = 1.5;
|
|
735
|
-
* } else if (playbackRate >= 1.0) {
|
|
736
|
-
* playbackRate = 1.25;
|
|
737
|
-
* }
|
|
738
|
-
* else if (playbackRate >= 0.5) {
|
|
739
|
-
* playbackRate = 1.0;
|
|
740
|
-
* }
|
|
741
|
-
* else if (playbackRate >= 0.25) {
|
|
742
|
-
* playbackRate = 0.5;
|
|
743
|
-
* } else if (playbackRate >= 0) {
|
|
744
|
-
* playbackRate = 0.25;
|
|
745
|
-
* }
|
|
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
|
+
* }
|
|
746
808
|
*/
|
|
747
809
|
actions.changeRate(playbackRate, {
|
|
748
810
|
action: 'fast-forward',
|
|
@@ -760,11 +822,11 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
760
822
|
}, {
|
|
761
823
|
key: "handleKeyPress",
|
|
762
824
|
value: function handleKeyPress(e) {
|
|
763
|
-
var _this$
|
|
764
|
-
player = _this$
|
|
765
|
-
actions = _this$
|
|
766
|
-
frameRate = _this$
|
|
767
|
-
markers = _this$
|
|
825
|
+
var _this$props9 = this.props,
|
|
826
|
+
player = _this$props9.player,
|
|
827
|
+
actions = _this$props9.actions,
|
|
828
|
+
frameRate = _this$props9.frameRate,
|
|
829
|
+
markers = _this$props9.markers;
|
|
768
830
|
if (!player.isActive) {
|
|
769
831
|
return;
|
|
770
832
|
}
|
|
@@ -803,10 +865,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
803
865
|
}, {
|
|
804
866
|
key: "handleClick",
|
|
805
867
|
value: function handleClick(e) {
|
|
806
|
-
var _this$
|
|
807
|
-
player = _this$
|
|
808
|
-
actions = _this$
|
|
809
|
-
clickable = _this$
|
|
868
|
+
var _this$props10 = this.props,
|
|
869
|
+
player = _this$props10.player,
|
|
870
|
+
actions = _this$props10.actions,
|
|
871
|
+
clickable = _this$props10.clickable;
|
|
810
872
|
if (!this.canBeClicked(player, e) || !clickable) {
|
|
811
873
|
return;
|
|
812
874
|
}
|
|
@@ -816,10 +878,10 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
816
878
|
}, {
|
|
817
879
|
key: "handleDoubleClick",
|
|
818
880
|
value: function handleDoubleClick(e) {
|
|
819
|
-
var _this$
|
|
820
|
-
player = _this$
|
|
821
|
-
actions = _this$
|
|
822
|
-
dblclickable = _this$
|
|
881
|
+
var _this$props11 = this.props,
|
|
882
|
+
player = _this$props11.player,
|
|
883
|
+
actions = _this$props11.actions,
|
|
884
|
+
dblclickable = _this$props11.dblclickable;
|
|
823
885
|
if (!this.canBeClicked(player, e) || !dblclickable) {
|
|
824
886
|
return;
|
|
825
887
|
}
|
|
@@ -827,9 +889,9 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
827
889
|
// e.preventDefault();
|
|
828
890
|
}
|
|
829
891
|
|
|
830
|
-
/*
|
|
831
|
-
* this component dose not render anything
|
|
832
|
-
* it's just for the key down event
|
|
892
|
+
/*
|
|
893
|
+
* this component dose not render anything
|
|
894
|
+
* it's just for the key down event
|
|
833
895
|
*/
|
|
834
896
|
}, {
|
|
835
897
|
key: "render",
|
|
@@ -837,6 +899,7 @@ var Shortcut = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
837
899
|
return null;
|
|
838
900
|
}
|
|
839
901
|
}]);
|
|
902
|
+
return Shortcut;
|
|
840
903
|
}(_react.Component);
|
|
841
904
|
Shortcut.propTypes = propTypes;
|
|
842
905
|
Shortcut.defaultProps = defaultProps;
|
package/components/Slider.js
CHANGED
|
@@ -12,23 +12,22 @@ 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(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
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 && Object.prototype.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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
22
|
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); }
|
|
24
23
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
25
|
-
function _possibleConstructorReturn(
|
|
26
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
24
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
25
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
|
-
function _getPrototypeOf(
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
function
|
|
26
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
29
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
32
31
|
var propTypes = {
|
|
33
32
|
theme: _propTypes.PropTypes.string,
|
|
34
33
|
onMouseDown: _propTypes.PropTypes.func,
|
|
@@ -70,29 +69,29 @@ var SliderBlock = _styledComponents["default"].div(_templateObject || (_template
|
|
|
70
69
|
return props.theme ? " ".concat(_tokens.colors[props.theme].base) : '#121d29';
|
|
71
70
|
});
|
|
72
71
|
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(_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);
|
|
77
|
+
_this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_this));
|
|
78
|
+
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
79
|
+
_this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_this));
|
|
80
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
81
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
82
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
83
|
+
_this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));
|
|
84
|
+
_this.stepForward = _this.stepForward.bind(_assertThisInitialized(_this));
|
|
85
|
+
_this.stepBack = _this.stepBack.bind(_assertThisInitialized(_this));
|
|
86
|
+
_this.calculateDistance = _this.calculateDistance.bind(_assertThisInitialized(_this));
|
|
87
|
+
_this.getProgress = _this.getProgress.bind(_assertThisInitialized(_this));
|
|
88
|
+
_this.renderChildren = _this.renderChildren.bind(_assertThisInitialized(_this));
|
|
89
89
|
_this.state = {
|
|
90
90
|
// active: false,
|
|
91
91
|
};
|
|
92
92
|
return _this;
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
return _createClass(Slider, [{
|
|
94
|
+
_createClass(Slider, [{
|
|
96
95
|
key: "getProgress",
|
|
97
96
|
value: function getProgress() {
|
|
98
97
|
var getPercent = this.props.getPercent;
|
|
@@ -113,9 +112,9 @@ var Slider = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
113
112
|
var _this$props = this.props,
|
|
114
113
|
onMouseDown = _this$props.onMouseDown,
|
|
115
114
|
sliderActive = _this$props.sliderActive;
|
|
116
|
-
/*
|
|
117
|
-
* event.preventDefault();
|
|
118
|
-
* event.stopPropagation();
|
|
115
|
+
/*
|
|
116
|
+
* event.preventDefault();
|
|
117
|
+
* event.stopPropagation();
|
|
119
118
|
*/
|
|
120
119
|
|
|
121
120
|
document.addEventListener('mousemove', this.handleMouseMove, true);
|
|
@@ -123,9 +122,9 @@ var Slider = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
123
122
|
document.addEventListener('touchmove', this.handleMouseMove, true);
|
|
124
123
|
document.addEventListener('touchend', this.handleMouseUp, true);
|
|
125
124
|
this.setState({
|
|
126
|
-
/*
|
|
127
|
-
* active: true,
|
|
128
|
-
* distance: 0
|
|
125
|
+
/*
|
|
126
|
+
* active: true,
|
|
127
|
+
* distance: 0
|
|
129
128
|
*/
|
|
130
129
|
});
|
|
131
130
|
if (sliderActive) {
|
|
@@ -272,6 +271,7 @@ var Slider = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
272
271
|
}, this.renderChildren());
|
|
273
272
|
}
|
|
274
273
|
}]);
|
|
274
|
+
return Slider;
|
|
275
275
|
}(_react.Component);
|
|
276
276
|
Slider.propTypes = propTypes;
|
|
277
277
|
Slider.defaultProps = defaultProps;
|