@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.
Files changed (68) hide show
  1. package/Manager.js +26 -50
  2. package/actions/player.js +58 -89
  3. package/actions/video.js +70 -69
  4. package/colors.js +13 -13
  5. package/components/AudioMeter.js +138 -182
  6. package/components/BigPlayButton.js +48 -72
  7. package/components/ImageViewer.js +120 -165
  8. package/components/MarkerBar.js +64 -75
  9. package/components/Menu.js +30 -57
  10. package/components/Player.js +267 -327
  11. package/components/PlayerHeader.js +213 -348
  12. package/components/Playlist.js +50 -89
  13. package/components/PointersBar.js +131 -203
  14. package/components/PosterImage.js +12 -22
  15. package/components/SDOutline.js +32 -54
  16. package/components/Shortcut.js +135 -140
  17. package/components/Slider.js +85 -128
  18. package/components/TagsBar.js +45 -62
  19. package/components/Video.js +479 -655
  20. package/components/control-bar/AudioTracksMenuButton.js +63 -86
  21. package/components/control-bar/CameraButton.js +65 -76
  22. package/components/control-bar/CommentsButton.js +97 -136
  23. package/components/control-bar/ControlBar.js +171 -164
  24. package/components/control-bar/EditorControlMenuButton.js +180 -280
  25. package/components/control-bar/ForwardControl.js +7 -11
  26. package/components/control-bar/ForwardReplayControl.js +41 -55
  27. package/components/control-bar/FullscreenToggle.js +48 -67
  28. package/components/control-bar/PlayToggle.js +39 -54
  29. package/components/control-bar/ReplayControl.js +7 -11
  30. package/components/control-bar/SettingsMenuButton.js +19 -29
  31. package/components/control-bar/SubtitleLanguagesMenuButton.js +90 -119
  32. package/components/control-bar/SubtitleMovementMenu.js +128 -0
  33. package/components/control-bar/VolumeMenuButton.js +71 -96
  34. package/components/control-bar/ZoomMenuButton.js +57 -81
  35. package/components/marking-controls/MarkInControl.js +49 -65
  36. package/components/marking-controls/MarkOutControl.js +53 -69
  37. package/components/marking-controls/MarkingAddButton.js +41 -54
  38. package/components/marking-controls/MarkingControl.js +58 -107
  39. package/components/marking-controls/MarkingDeleteButton.js +39 -51
  40. package/components/marking-controls/MarkingDuration.js +23 -56
  41. package/components/marking-controls/MarkingPreview.js +39 -51
  42. package/components/progress-bar/AudioWaveform.js +48 -64
  43. package/components/progress-bar/LoadProgressBar.js +14 -37
  44. package/components/progress-bar/MouseTimeDisplay.js +14 -30
  45. package/components/progress-bar/PlayProgressBar.js +23 -41
  46. package/components/progress-bar/ProgressControl.js +82 -141
  47. package/components/progress-bar/SeekBar.js +101 -169
  48. package/components/progress-bar/Timeline.js +57 -81
  49. package/components/settings-menu-control/PlaybackRateControl.js +70 -115
  50. package/components/settings-menu-control/SafeAreaControl.js +49 -65
  51. package/components/settings-menu-control/SettingsMenu.js +26 -50
  52. package/components/time-controls/CurrentTimeDisplay.js +15 -34
  53. package/components/time-controls/DurationDisplay.js +14 -33
  54. package/components/time-controls/TimeDivider.js +12 -28
  55. package/components/volume-control/VolumeBar.js +84 -118
  56. package/components/volume-control/VolumeControl.js +7 -23
  57. package/components/volume-control/VolumeLevel.js +19 -36
  58. package/components/zoom-control/ZoomBar.js +79 -111
  59. package/components/zoom-control/ZoomLevel.js +24 -36
  60. package/index.js +204 -149
  61. package/package.json +5 -1
  62. package/reducers/index.js +12 -14
  63. package/reducers/operation.js +14 -14
  64. package/reducers/player.js +40 -42
  65. package/utils/browser.js +10 -5
  66. package/utils/dom.js +4 -15
  67. package/utils/fullscreen.js +24 -24
  68. package/utils/index.js +35 -46
@@ -1,41 +1,33 @@
1
- 'use strict';
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 _createClass = function () { 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- var _propTypes = require('prop-types');
10
-
11
- var _react = require('react');
12
-
13
- var _react2 = _interopRequireDefault(_react);
14
-
15
- var _reactDom = require('react-dom');
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
36
-
37
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
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 SliderBlock = _styledComponents2.default.div.withConfig({
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
- var _this = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, props, context));
89
-
90
- _this.handleMouseDown = _this.handleMouseDown.bind(_this);
91
- _this.handleMouseMove = _this.handleMouseMove.bind(_this);
92
- _this.handleMouseUp = _this.handleMouseUp.bind(_this);
93
- _this.handleFocus = _this.handleFocus.bind(_this);
94
- _this.handleBlur = _this.handleBlur.bind(_this);
95
- _this.handleClick = _this.handleClick.bind(_this);
96
- _this.handleKeyPress = _this.handleKeyPress.bind(_this);
97
- _this.stepForward = _this.stepForward.bind(_this);
98
- _this.stepBack = _this.stepBack.bind(_this);
99
- _this.calculateDistance = _this.calculateDistance.bind(_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: 'getProgress',
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: 'handleMouseDown',
108
+ key: "handleMouseDown",
127
109
  value: function handleMouseDown(event) {
128
- var _props = this.props,
129
- onMouseDown = _props.onMouseDown,
130
- sliderActive = _props.sliderActive;
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: 'handleMouseMove',
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: 'handleMouseUp',
145
+ key: "handleMouseUp",
170
146
  value: function handleMouseUp(event) {
171
- var _props2 = this.props,
172
- onMouseUp = _props2.onMouseUp,
173
- sliderInactive = _props2.sliderInactive;
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: 'handleFocus',
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: 'handleBlur',
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: 'handleClick',
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: 'handleKeyPress',
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: 'stepForward',
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: 'stepBack',
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: 'calculateDistance',
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: 'renderChildren',
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
- return _react2.default.Children.map(children, function (child) {
277
- return _react2.default.cloneElement(child, { progress: progress, percentage: percentage });
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: 'render',
248
+ key: "render",
282
249
  value: function render() {
283
- var _props3 = this.props,
284
- label = _props3.label,
285
- valuenow = _props3.valuenow,
286
- valuetext = _props3.valuetext;
287
-
288
-
289
- return _react2.default.createElement(
290
- SliderBlock,
291
- {
292
- tabIndex: '0',
293
- onMouseDown: this.handleMouseDown,
294
- onTouchStart: this.handleMouseDown,
295
- onFocus: this.handleFocus,
296
- onBlur: this.handleBlur,
297
- onClick: this.handleClick,
298
- 'aria-label': label || '',
299
- 'aria-valuenow': valuenow || '',
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';
@@ -1,100 +1,83 @@
1
- 'use strict';
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 _createClass = function () { 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- var _react = require('react');
10
-
11
- var _react2 = _interopRequireDefault(_react);
12
-
13
- var _propTypes = require('prop-types');
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24
-
25
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
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 TagsBlock = _styledComponents2.default.div.withConfig({
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
- var _this = _possibleConstructorReturn(this, (TagsBar.__proto__ || Object.getPrototypeOf(TagsBar)).call(this, props));
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: 'getMarkerPosition',
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: 'goToMarker',
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: 'render',
60
+ key: "render",
69
61
  value: function render() {
70
62
  var _this2 = this;
71
-
72
63
  var tagsMarker = this.props.tagsMarker;
73
-
74
-
75
- return _react2.default.createElement(
76
- TagsBlock,
77
- null,
78
- tagsMarker.map(function (marker) {
79
- return _react2.default.createElement('div', {
80
- className: 'marker',
81
- role: 'presentation',
82
- key: marker.leftOffset,
83
- onClick: function onClick() {
84
- return _this2.goToMarker(marker.timeOffset);
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';