@desynova-digital/player 3.9.7 → 3.9.8
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 +26 -50
- package/actions/player.js +58 -89
- package/actions/video.js +70 -69
- package/colors.js +13 -13
- package/components/AudioMeter.js +138 -182
- package/components/BigPlayButton.js +48 -72
- package/components/ImageViewer.js +120 -165
- package/components/MarkerBar.js +64 -75
- package/components/Menu.js +30 -57
- package/components/Player.js +267 -327
- package/components/PlayerHeader.js +213 -348
- package/components/Playlist.js +50 -89
- package/components/PointersBar.js +131 -203
- package/components/PosterImage.js +12 -22
- package/components/SDOutline.js +32 -54
- package/components/Shortcut.js +135 -140
- package/components/Slider.js +85 -128
- package/components/TagsBar.js +45 -62
- package/components/Video.js +479 -655
- package/components/control-bar/AudioTracksMenuButton.js +63 -86
- package/components/control-bar/CameraButton.js +65 -76
- package/components/control-bar/CommentsButton.js +97 -136
- package/components/control-bar/ControlBar.js +171 -164
- package/components/control-bar/EditorControlMenuButton.js +180 -280
- package/components/control-bar/ForwardControl.js +7 -11
- package/components/control-bar/ForwardReplayControl.js +41 -55
- package/components/control-bar/FullscreenToggle.js +48 -67
- package/components/control-bar/PlayToggle.js +39 -54
- package/components/control-bar/ReplayControl.js +7 -11
- package/components/control-bar/SettingsMenuButton.js +19 -29
- package/components/control-bar/SubtitleLanguagesMenuButton.js +90 -119
- package/components/control-bar/SubtitleMovementMenu.js +128 -0
- package/components/control-bar/VolumeMenuButton.js +71 -96
- package/components/control-bar/ZoomMenuButton.js +57 -81
- package/components/marking-controls/MarkInControl.js +49 -65
- package/components/marking-controls/MarkOutControl.js +53 -69
- package/components/marking-controls/MarkingAddButton.js +41 -54
- package/components/marking-controls/MarkingControl.js +58 -107
- package/components/marking-controls/MarkingDeleteButton.js +39 -51
- package/components/marking-controls/MarkingDuration.js +23 -56
- package/components/marking-controls/MarkingPreview.js +39 -51
- package/components/progress-bar/AudioWaveform.js +48 -64
- package/components/progress-bar/LoadProgressBar.js +14 -37
- package/components/progress-bar/MouseTimeDisplay.js +14 -30
- package/components/progress-bar/PlayProgressBar.js +23 -41
- package/components/progress-bar/ProgressControl.js +82 -141
- package/components/progress-bar/SeekBar.js +101 -169
- package/components/progress-bar/Timeline.js +57 -81
- package/components/settings-menu-control/PlaybackRateControl.js +70 -115
- package/components/settings-menu-control/SafeAreaControl.js +49 -65
- package/components/settings-menu-control/SettingsMenu.js +26 -50
- package/components/time-controls/CurrentTimeDisplay.js +15 -34
- package/components/time-controls/DurationDisplay.js +14 -33
- package/components/time-controls/TimeDivider.js +12 -28
- package/components/volume-control/VolumeBar.js +84 -118
- package/components/volume-control/VolumeControl.js +7 -23
- package/components/volume-control/VolumeLevel.js +19 -36
- package/components/zoom-control/ZoomBar.js +79 -111
- package/components/zoom-control/ZoomLevel.js +24 -36
- package/index.js +204 -149
- package/package.json +5 -1
- package/reducers/index.js +12 -14
- package/reducers/operation.js +14 -14
- package/reducers/player.js +40 -42
- package/utils/browser.js +10 -5
- package/utils/dom.js +4 -15
- package/utils/fullscreen.js +24 -24
- package/utils/index.js +35 -46
package/components/Slider.js
CHANGED
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var _styledComponents = require('styled-components');
|
|
18
|
-
|
|
19
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
20
|
-
|
|
21
|
-
var _colors = require('../colors');
|
|
22
|
-
|
|
23
|
-
var _colors2 = _interopRequireDefault(_colors);
|
|
24
|
-
|
|
25
|
-
var _dom = require('../utils/dom');
|
|
26
|
-
|
|
27
|
-
var Dom = _interopRequireWildcard(_dom);
|
|
28
|
-
|
|
29
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
30
|
-
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactDom = require("react-dom");
|
|
11
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _colors = _interopRequireDefault(require("../colors"));
|
|
13
|
+
var Dom = _interopRequireWildcard(require("../utils/dom"));
|
|
14
|
+
var _templateObject;
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
34
|
-
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
|
+
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); }
|
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
26
|
+
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
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
39
31
|
var propTypes = {
|
|
40
32
|
onMouseDown: _propTypes.PropTypes.func,
|
|
41
33
|
onMouseMove: _propTypes.PropTypes.func,
|
|
@@ -54,7 +46,6 @@ var propTypes = {
|
|
|
54
46
|
valuenow: _propTypes.PropTypes.string,
|
|
55
47
|
valuetext: _propTypes.PropTypes.string
|
|
56
48
|
};
|
|
57
|
-
|
|
58
49
|
var defaultProps = {
|
|
59
50
|
onMouseDown: null,
|
|
60
51
|
onMouseMove: null,
|
|
@@ -73,44 +64,35 @@ var defaultProps = {
|
|
|
73
64
|
valuenow: '',
|
|
74
65
|
valuetext: ''
|
|
75
66
|
};
|
|
76
|
-
|
|
77
|
-
var
|
|
78
|
-
displayName: 'Slider__SliderBlock',
|
|
79
|
-
componentId: 'sc-i91ua7-0'
|
|
80
|
-
})(['position:relative;z-index:2;width:100%;height:100%;background:', ';'], _colors2.default.dark.base);
|
|
81
|
-
|
|
82
|
-
var Slider = function (_Component) {
|
|
67
|
+
var SliderBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n z-index: 2;\n width: 100%;\n height: 100%;\n background: ", ";\n"])), _colors["default"].dark.base);
|
|
68
|
+
var Slider = /*#__PURE__*/function (_Component) {
|
|
83
69
|
_inherits(Slider, _Component);
|
|
84
|
-
|
|
70
|
+
var _super = _createSuper(Slider);
|
|
85
71
|
function Slider(props, context) {
|
|
72
|
+
var _this;
|
|
86
73
|
_classCallCheck(this, Slider);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_this.
|
|
91
|
-
_this.
|
|
92
|
-
_this.
|
|
93
|
-
_this.
|
|
94
|
-
_this.
|
|
95
|
-
_this.
|
|
96
|
-
_this.
|
|
97
|
-
_this.
|
|
98
|
-
_this.
|
|
99
|
-
_this.
|
|
100
|
-
_this.getProgress = _this.getProgress.bind(_this);
|
|
101
|
-
_this.renderChildren = _this.renderChildren.bind(_this);
|
|
102
|
-
|
|
74
|
+
_this = _super.call(this, props, context);
|
|
75
|
+
_this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_this));
|
|
76
|
+
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
77
|
+
_this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_this));
|
|
78
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
79
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
80
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
81
|
+
_this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));
|
|
82
|
+
_this.stepForward = _this.stepForward.bind(_assertThisInitialized(_this));
|
|
83
|
+
_this.stepBack = _this.stepBack.bind(_assertThisInitialized(_this));
|
|
84
|
+
_this.calculateDistance = _this.calculateDistance.bind(_assertThisInitialized(_this));
|
|
85
|
+
_this.getProgress = _this.getProgress.bind(_assertThisInitialized(_this));
|
|
86
|
+
_this.renderChildren = _this.renderChildren.bind(_assertThisInitialized(_this));
|
|
103
87
|
_this.state = {
|
|
104
88
|
// active: false,
|
|
105
89
|
};
|
|
106
90
|
return _this;
|
|
107
91
|
}
|
|
108
|
-
|
|
109
92
|
_createClass(Slider, [{
|
|
110
|
-
key:
|
|
93
|
+
key: "getProgress",
|
|
111
94
|
value: function getProgress() {
|
|
112
95
|
var getPercent = this.props.getPercent;
|
|
113
|
-
|
|
114
96
|
if (!getPercent) {
|
|
115
97
|
return 0;
|
|
116
98
|
}
|
|
@@ -123,11 +105,11 @@ var Slider = function (_Component) {
|
|
|
123
105
|
return progress;
|
|
124
106
|
}
|
|
125
107
|
}, {
|
|
126
|
-
key:
|
|
108
|
+
key: "handleMouseDown",
|
|
127
109
|
value: function handleMouseDown(event) {
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
110
|
+
var _this$props = this.props,
|
|
111
|
+
onMouseDown = _this$props.onMouseDown,
|
|
112
|
+
sliderActive = _this$props.sliderActive;
|
|
131
113
|
/*
|
|
132
114
|
* event.preventDefault();
|
|
133
115
|
* event.stopPropagation();
|
|
@@ -137,84 +119,70 @@ var Slider = function (_Component) {
|
|
|
137
119
|
document.addEventListener('mouseup', this.handleMouseUp, true);
|
|
138
120
|
document.addEventListener('touchmove', this.handleMouseMove, true);
|
|
139
121
|
document.addEventListener('touchend', this.handleMouseUp, true);
|
|
140
|
-
|
|
141
122
|
this.setState({
|
|
142
123
|
/*
|
|
143
124
|
* active: true,
|
|
144
125
|
* distance: 0
|
|
145
126
|
*/
|
|
146
127
|
});
|
|
147
|
-
|
|
148
128
|
if (sliderActive) {
|
|
149
129
|
sliderActive(event);
|
|
150
130
|
}
|
|
151
|
-
|
|
152
131
|
this.handleMouseMove(event);
|
|
153
|
-
|
|
154
132
|
if (onMouseDown) {
|
|
155
133
|
onMouseDown(event);
|
|
156
134
|
}
|
|
157
135
|
}
|
|
158
136
|
}, {
|
|
159
|
-
key:
|
|
137
|
+
key: "handleMouseMove",
|
|
160
138
|
value: function handleMouseMove(event) {
|
|
161
139
|
var onMouseMove = this.props.onMouseMove;
|
|
162
|
-
|
|
163
|
-
|
|
164
140
|
if (onMouseMove) {
|
|
165
141
|
onMouseMove(event);
|
|
166
142
|
}
|
|
167
143
|
}
|
|
168
144
|
}, {
|
|
169
|
-
key:
|
|
145
|
+
key: "handleMouseUp",
|
|
170
146
|
value: function handleMouseUp(event) {
|
|
171
|
-
var
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
147
|
+
var _this$props2 = this.props,
|
|
148
|
+
onMouseUp = _this$props2.onMouseUp,
|
|
149
|
+
sliderInactive = _this$props2.sliderInactive;
|
|
176
150
|
document.removeEventListener('mousemove', this.handleMouseMove, true);
|
|
177
151
|
document.removeEventListener('mouseup', this.handleMouseUp, true);
|
|
178
152
|
document.removeEventListener('touchmove', this.handleMouseMove, true);
|
|
179
153
|
document.removeEventListener('touchend', this.handleMouseUp, true);
|
|
180
|
-
|
|
181
154
|
this.setState({
|
|
182
155
|
// active: false
|
|
183
156
|
});
|
|
184
|
-
|
|
185
157
|
if (sliderInactive) {
|
|
186
158
|
sliderInactive(event);
|
|
187
159
|
}
|
|
188
|
-
|
|
189
160
|
if (onMouseUp) {
|
|
190
161
|
onMouseUp(event);
|
|
191
162
|
}
|
|
192
163
|
}
|
|
193
164
|
}, {
|
|
194
|
-
key:
|
|
165
|
+
key: "handleFocus",
|
|
195
166
|
value: function handleFocus(e) {
|
|
196
167
|
var onFocus = this.props.onFocus;
|
|
197
|
-
|
|
198
168
|
document.addEventListener('keydown', this.handleKeyPress, true);
|
|
199
169
|
if (onFocus) {
|
|
200
170
|
onFocus(e);
|
|
201
171
|
}
|
|
202
172
|
}
|
|
203
173
|
}, {
|
|
204
|
-
key:
|
|
174
|
+
key: "handleBlur",
|
|
205
175
|
value: function handleBlur(e) {
|
|
206
176
|
var onBlur = this.props.onBlur;
|
|
207
|
-
|
|
208
177
|
document.removeEventListener('keydown', this.handleKeyPress, true);
|
|
209
178
|
if (onBlur) {
|
|
210
179
|
onBlur(e);
|
|
211
180
|
}
|
|
212
181
|
}
|
|
213
182
|
}, {
|
|
214
|
-
key:
|
|
183
|
+
key: "handleClick",
|
|
215
184
|
value: function handleClick(event) {
|
|
216
185
|
var onClick = this.props.onClick;
|
|
217
|
-
|
|
218
186
|
event.preventDefault();
|
|
219
187
|
// event.stopPropagation();
|
|
220
188
|
if (onClick) {
|
|
@@ -222,7 +190,7 @@ var Slider = function (_Component) {
|
|
|
222
190
|
}
|
|
223
191
|
}
|
|
224
192
|
}, {
|
|
225
|
-
key:
|
|
193
|
+
key: "handleKeyPress",
|
|
226
194
|
value: function handleKeyPress(event) {
|
|
227
195
|
if (event.which === 37 || event.which === 40) {
|
|
228
196
|
// Left and Down Arrows
|
|
@@ -237,81 +205,70 @@ var Slider = function (_Component) {
|
|
|
237
205
|
}
|
|
238
206
|
}
|
|
239
207
|
}, {
|
|
240
|
-
key:
|
|
208
|
+
key: "stepForward",
|
|
241
209
|
value: function stepForward() {
|
|
242
210
|
var stepForward = this.props.stepForward;
|
|
243
|
-
|
|
244
211
|
if (stepForward) {
|
|
245
212
|
stepForward();
|
|
246
213
|
}
|
|
247
214
|
}
|
|
248
215
|
}, {
|
|
249
|
-
key:
|
|
216
|
+
key: "stepBack",
|
|
250
217
|
value: function stepBack() {
|
|
251
218
|
var stepBack = this.props.stepBack;
|
|
252
|
-
|
|
253
219
|
if (stepBack) {
|
|
254
220
|
stepBack();
|
|
255
221
|
}
|
|
256
222
|
}
|
|
257
223
|
}, {
|
|
258
|
-
key:
|
|
224
|
+
key: "calculateDistance",
|
|
259
225
|
value: function calculateDistance(event) {
|
|
260
226
|
var node = (0, _reactDom.findDOMNode)(this);
|
|
261
227
|
var position = Dom.getPointerPosition(node, event);
|
|
262
228
|
var vertical = this.props.vertical;
|
|
263
|
-
|
|
264
229
|
if (vertical) {
|
|
265
230
|
return position.y;
|
|
266
231
|
}
|
|
267
232
|
return position.x;
|
|
268
233
|
}
|
|
269
234
|
}, {
|
|
270
|
-
key:
|
|
235
|
+
key: "renderChildren",
|
|
271
236
|
value: function renderChildren() {
|
|
272
237
|
var progress = this.getProgress();
|
|
273
|
-
var percentage = (progress * 100).toFixed(2)
|
|
238
|
+
var percentage = "".concat((progress * 100).toFixed(2), "%");
|
|
274
239
|
var children = this.props.children;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
240
|
+
return _react["default"].Children.map(children, function (child) {
|
|
241
|
+
return /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
242
|
+
progress: progress,
|
|
243
|
+
percentage: percentage
|
|
244
|
+
});
|
|
278
245
|
});
|
|
279
246
|
}
|
|
280
247
|
}, {
|
|
281
|
-
key:
|
|
248
|
+
key: "render",
|
|
282
249
|
value: function render() {
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
'aria-valuetext': valuetext || '',
|
|
301
|
-
'aria-valuemin': 0,
|
|
302
|
-
'aria-valuemax': 100
|
|
303
|
-
},
|
|
304
|
-
this.renderChildren()
|
|
305
|
-
);
|
|
250
|
+
var _this$props3 = this.props,
|
|
251
|
+
label = _this$props3.label,
|
|
252
|
+
valuenow = _this$props3.valuenow,
|
|
253
|
+
valuetext = _this$props3.valuetext;
|
|
254
|
+
return /*#__PURE__*/_react["default"].createElement(SliderBlock, {
|
|
255
|
+
tabIndex: "0",
|
|
256
|
+
onMouseDown: this.handleMouseDown,
|
|
257
|
+
onTouchStart: this.handleMouseDown,
|
|
258
|
+
onFocus: this.handleFocus,
|
|
259
|
+
onBlur: this.handleBlur,
|
|
260
|
+
onClick: this.handleClick,
|
|
261
|
+
"aria-label": label || '',
|
|
262
|
+
"aria-valuenow": valuenow || '',
|
|
263
|
+
"aria-valuetext": valuetext || '',
|
|
264
|
+
"aria-valuemin": 0,
|
|
265
|
+
"aria-valuemax": 100
|
|
266
|
+
}, this.renderChildren());
|
|
306
267
|
}
|
|
307
268
|
}]);
|
|
308
|
-
|
|
309
269
|
return Slider;
|
|
310
270
|
}(_react.Component);
|
|
311
|
-
|
|
312
|
-
exports.default = Slider;
|
|
313
|
-
|
|
314
|
-
|
|
271
|
+
exports["default"] = Slider;
|
|
315
272
|
Slider.propTypes = propTypes;
|
|
316
273
|
Slider.defaultProps = defaultProps;
|
|
317
274
|
Slider.displayName = 'Slider';
|
package/components/TagsBar.js
CHANGED
|
@@ -1,100 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var _styledComponents = require('styled-components');
|
|
16
|
-
|
|
17
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
18
|
-
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _propTypes = require("prop-types");
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _templateObject;
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
16
|
+
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); } }
|
|
17
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
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); }
|
|
21
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
23
|
+
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); }
|
|
24
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
27
28
|
var propTypes = {
|
|
28
29
|
tagsMarker: _propTypes.PropTypes.instanceOf(Array),
|
|
29
30
|
player: _propTypes.PropTypes.instanceOf(Object),
|
|
30
31
|
actions: _propTypes.PropTypes.instanceOf(Object)
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
displayName: 'TagsBar__TagsBlock',
|
|
35
|
-
componentId: 'sc-n53sgs-0'
|
|
36
|
-
})(['width:100%;height:10px;position:absolute;bottom:40px;cursor:default;.marker{position:absolute;width:2px;height:100%;background:#00cec6;cursor:pointer;transition:transform 250ms ease-in-out;&:hover{transform:scale(2);}}']);
|
|
37
|
-
|
|
38
|
-
var TagsBar = function (_Component) {
|
|
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
|
+
var TagsBar = /*#__PURE__*/function (_Component) {
|
|
39
35
|
_inherits(TagsBar, _Component);
|
|
40
|
-
|
|
36
|
+
var _super = _createSuper(TagsBar);
|
|
41
37
|
function TagsBar(props) {
|
|
38
|
+
var _this;
|
|
42
39
|
_classCallCheck(this, TagsBar);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_this.getMarkerPosition = _this.getMarkerPosition.bind(_this);
|
|
40
|
+
_this = _super.call(this, props);
|
|
41
|
+
_this.getMarkerPosition = _this.getMarkerPosition.bind(_assertThisInitialized(_this));
|
|
47
42
|
return _this;
|
|
48
43
|
}
|
|
49
|
-
|
|
50
44
|
_createClass(TagsBar, [{
|
|
51
|
-
key:
|
|
45
|
+
key: "getMarkerPosition",
|
|
52
46
|
value: function getMarkerPosition(timePos) {
|
|
53
47
|
var player = this.props.player;
|
|
54
|
-
|
|
55
48
|
var time = parseInt(timePos);
|
|
56
49
|
var percent = time / player.duration;
|
|
57
50
|
var left = (percent * 100).toFixed(2) + '%';
|
|
58
51
|
return percent >= 1 ? '100%' : left;
|
|
59
52
|
}
|
|
60
53
|
}, {
|
|
61
|
-
key:
|
|
54
|
+
key: "goToMarker",
|
|
62
55
|
value: function goToMarker(time) {
|
|
63
56
|
var actions = this.props.actions;
|
|
64
|
-
|
|
65
57
|
actions.seek(parseInt(time));
|
|
66
58
|
}
|
|
67
59
|
}, {
|
|
68
|
-
key:
|
|
60
|
+
key: "render",
|
|
69
61
|
value: function render() {
|
|
70
62
|
var _this2 = this;
|
|
71
|
-
|
|
72
63
|
var tagsMarker = this.props.tagsMarker;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
style: { left: _this2.getMarkerPosition(marker.timeOffset) }
|
|
87
|
-
});
|
|
88
|
-
})
|
|
89
|
-
);
|
|
64
|
+
return /*#__PURE__*/_react["default"].createElement(TagsBlock, null, tagsMarker.map(function (marker) {
|
|
65
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
|
+
className: "marker",
|
|
67
|
+
role: "presentation",
|
|
68
|
+
key: marker.leftOffset,
|
|
69
|
+
onClick: function onClick() {
|
|
70
|
+
return _this2.goToMarker(marker.timeOffset);
|
|
71
|
+
},
|
|
72
|
+
style: {
|
|
73
|
+
left: _this2.getMarkerPosition(marker.timeOffset)
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}));
|
|
90
77
|
}
|
|
91
78
|
}]);
|
|
92
|
-
|
|
93
79
|
return TagsBar;
|
|
94
80
|
}(_react.Component);
|
|
95
|
-
|
|
96
|
-
exports.default = TagsBar;
|
|
97
|
-
|
|
98
|
-
|
|
81
|
+
exports["default"] = TagsBar;
|
|
99
82
|
TagsBar.propTypes = propTypes;
|
|
100
83
|
TagsBar.displayName = 'TagsBar';
|