@desynova-digital/player 4.0.0 → 4.0.2

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 (111) hide show
  1. package/Manager.js +99 -0
  2. package/actions/player.js +331 -0
  3. package/actions/video.js +206 -0
  4. package/{utils/colors.js → colors.js} +1 -2
  5. package/{media → components}/AudioMeter.js +96 -109
  6. package/components/BigPlayButton.js +84 -0
  7. package/components/ImageViewer.js +272 -0
  8. package/{control → components}/MarkerBar.js +33 -24
  9. package/{utils → components}/Menu.js +13 -4
  10. package/components/Player.js +706 -0
  11. package/{header/Header.js → components/PlayerHeader.js} +104 -78
  12. package/components/Playlist.js +95 -0
  13. package/{control → components}/PointersBar.js +122 -61
  14. package/components/PosterImage.js +50 -0
  15. package/{media → components}/SDOutline.js +13 -49
  16. package/components/Shortcut.js +821 -0
  17. package/{control → components}/Slider.js +27 -23
  18. package/components/TagsBar.js +81 -0
  19. package/components/Video.js +1280 -0
  20. package/{control → components/control-bar}/AudioTracksMenuButton.js +32 -28
  21. package/components/control-bar/CameraButton.js +75 -0
  22. package/components/control-bar/CommentsButton.js +186 -0
  23. package/components/control-bar/ControlBar.js +266 -0
  24. package/components/control-bar/EditorControlMenuButton.js +317 -0
  25. package/components/control-bar/ForwardControl.js +12 -0
  26. package/components/control-bar/ForwardReplayControl.js +106 -0
  27. package/{control → components/control-bar}/FullscreenToggle.js +26 -21
  28. package/components/control-bar/PlayToggle.js +85 -0
  29. package/components/control-bar/ReplayControl.js +12 -0
  30. package/components/control-bar/SettingsMenuButton.js +41 -0
  31. package/components/control-bar/SubtitleLanguagesMenuButton.js +149 -0
  32. package/components/control-bar/SubtitleMovementMenu.js +140 -0
  33. package/{control/VolumneMenuButton.js → components/control-bar/VolumeMenuButton.js} +26 -27
  34. package/components/control-bar/ZoomMenuButton.js +90 -0
  35. package/{control → components/marking-controls}/MarkInControl.js +32 -25
  36. package/{control → components/marking-controls}/MarkOutControl.js +35 -26
  37. package/components/marking-controls/MarkingAddButton.js +79 -0
  38. package/components/marking-controls/MarkingControl.js +95 -0
  39. package/components/marking-controls/MarkingDeleteButton.js +70 -0
  40. package/{control → components/marking-controls}/MarkingDuration.js +12 -5
  41. package/components/marking-controls/MarkingPreview.js +72 -0
  42. package/components/progress-bar/AudioWaveform.js +126 -0
  43. package/components/progress-bar/LoadProgressBar.js +67 -0
  44. package/components/progress-bar/MouseTimeDisplay.js +36 -0
  45. package/{control → components/progress-bar}/PlayProgressBar.js +4 -4
  46. package/components/progress-bar/ProgressControl.js +186 -0
  47. package/{control → components/progress-bar}/SeekBar.js +113 -72
  48. package/{control → components/progress-bar}/Timeline.js +43 -32
  49. package/{control/PlayBackRateControl.js → components/settings-menu-control/PlaybackRateControl.js} +44 -30
  50. package/components/settings-menu-control/SafeAreaControl.js +81 -0
  51. package/components/settings-menu-control/SettingsMenu.js +56 -0
  52. package/components/settings-menu-control/SubtitleControl.js +1 -0
  53. package/components/time-controls/CurrentTimeDisplay.js +83 -0
  54. package/{control → components/time-controls}/DurationDisplay.js +8 -15
  55. package/components/time-controls/TimeDivider.js +25 -0
  56. package/{control → components/volume-control}/VolumeBar.js +62 -80
  57. package/components/volume-control/VolumeControl.js +19 -0
  58. package/{control → components/volume-control}/VolumeLevel.js +2 -3
  59. package/components/zoom-control/ZoomBar.js +155 -0
  60. package/components/zoom-control/ZoomLevel.js +55 -0
  61. package/index.js +198 -1
  62. package/package.json +5 -8
  63. package/reducers/index.js +19 -0
  64. package/reducers/operation.js +35 -0
  65. package/reducers/player.js +222 -0
  66. package/utils/browser.js +30 -0
  67. package/utils/dom.js +93 -0
  68. package/utils/fullscreen.js +72 -0
  69. package/utils/index.js +156 -57
  70. package/Player.js +0 -945
  71. package/control/AudioTracksMenuButton.jsx +0 -80
  72. package/control/ControlBar.js +0 -303
  73. package/control/ControlBar.jsx +0 -264
  74. package/control/CurrentTimeDisplay.js +0 -34
  75. package/control/CurrentTimeDisplay.jsx +0 -35
  76. package/control/DurationDisplay.jsx +0 -48
  77. package/control/ForwardBackwardControl.js +0 -76
  78. package/control/ForwardBackwardControl.jsx +0 -79
  79. package/control/FullscreenToggle.jsx +0 -83
  80. package/control/MarkInControl.jsx +0 -109
  81. package/control/MarkOutControl.jsx +0 -131
  82. package/control/MarkerBar.jsx +0 -107
  83. package/control/MarkingControl.js +0 -82
  84. package/control/MarkingControl.jsx +0 -143
  85. package/control/MarkingPreview.js +0 -49
  86. package/control/MarkingPreview.jsx +0 -60
  87. package/control/PlayBackRateControl.jsx +0 -106
  88. package/control/PlayProgressBar.jsx +0 -92
  89. package/control/PlayToggle.js +0 -56
  90. package/control/PlayToggle.jsx +0 -57
  91. package/control/PointersBar.jsx +0 -286
  92. package/control/ProgressControl.js +0 -127
  93. package/control/ProgressControl.jsx +0 -155
  94. package/control/SeekBar.jsx +0 -229
  95. package/control/SettingsMenuButton.js +0 -63
  96. package/control/SettingsMenuButton.jsx +0 -69
  97. package/control/Slider.jsx +0 -243
  98. package/control/Timeline.jsx +0 -131
  99. package/control/VolumeBar.jsx +0 -174
  100. package/control/VolumeLevel.jsx +0 -66
  101. package/control/VolumneMenuButton.jsx +0 -111
  102. package/header/Header.jsx +0 -479
  103. package/media/AudioMeter.jsx +0 -411
  104. package/media/SDOutline.jsx +0 -90
  105. package/media/Video.js +0 -684
  106. package/media/Video.jsx +0 -714
  107. package/playlist/Playlist.js +0 -67
  108. package/playlist/Playlist.jsx +0 -91
  109. package/playlist/index.js +0 -13
  110. package/shortcuts/Shortcut.js +0 -662
  111. package/utils/Menu.jsx +0 -105
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ 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); }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ 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); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ var Fullscreen = /*#__PURE__*/function () {
14
+ function Fullscreen() {
15
+ _classCallCheck(this, Fullscreen);
16
+ }
17
+ _createClass(Fullscreen, [{
18
+ key: "request",
19
+ value: function request(elm) {
20
+ if (elm.requestFullscreen) {
21
+ elm.requestFullscreen();
22
+ } else if (elm.webkitRequestFullscreen) {
23
+ elm.webkitRequestFullscreen();
24
+ } else if (elm.mozRequestFullScreen) {
25
+ elm.mozRequestFullScreen();
26
+ } else if (elm.msRequestFullscreen) {
27
+ elm.msRequestFullscreen();
28
+ }
29
+ }
30
+ }, {
31
+ key: "exit",
32
+ value: function exit() {
33
+ if (document.exitFullscreen) {
34
+ document.exitFullscreen();
35
+ } else if (document.webkitExitFullscreen) {
36
+ document.webkitExitFullscreen();
37
+ } else if (document.mozCancelFullScreen) {
38
+ document.mozCancelFullScreen();
39
+ } else if (document.msExitFullscreen) {
40
+ document.msExitFullscreen();
41
+ }
42
+ }
43
+ }, {
44
+ key: "isFullscreen",
45
+ get: function get() {
46
+ return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;
47
+ }
48
+ }, {
49
+ key: "enabled",
50
+ get: function get() {
51
+ return document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled;
52
+ }
53
+ }, {
54
+ key: "addEventListener",
55
+ value: function addEventListener(handler) {
56
+ document.addEventListener('fullscreenchange', handler);
57
+ document.addEventListener('webkitfullscreenchange', handler);
58
+ document.addEventListener('mozfullscreenchange', handler);
59
+ document.addEventListener('MSFullscreenChange', handler);
60
+ }
61
+ }, {
62
+ key: "removeEventListener",
63
+ value: function removeEventListener(handler) {
64
+ document.removeEventListener('fullscreenchange', handler);
65
+ document.removeEventListener('webkitfullscreenchange', handler);
66
+ document.removeEventListener('mozfullscreenchange', handler);
67
+ document.removeEventListener('MSFullscreenChange', handler);
68
+ }
69
+ }]);
70
+ return Fullscreen;
71
+ }();
72
+ var _default = exports["default"] = new Fullscreen();
package/utils/index.js CHANGED
@@ -3,51 +3,29 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.deprecatedWarning = deprecatedWarning;
6
7
  exports.formatTime = formatTime;
8
+ exports.handleAdjustingVideoAsPerFrame = handleAdjustingVideoAsPerFrame;
9
+ exports.isVideoChild = isVideoChild;
10
+ exports.mediaProperties = void 0;
7
11
  exports.mergeAndSortChildren = mergeAndSortChildren;
8
12
  exports.secondsToTime = secondsToTime;
13
+ exports.throttle = throttle;
9
14
  exports.timeToSeconds = timeToSeconds;
10
- var _react = require("react");
11
- 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); }
12
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
+ var _react = _interopRequireDefault(require("react"));
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+ 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); }
18
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
19
+ 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."); }
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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
22
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
+ 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; }
24
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
26
  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; }
15
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
- 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); }
17
- /*
18
- * merge default children
19
- * sort them by `order` property
20
- * filter them by `disabled` property
21
- */
22
- function mergeAndSortChildren(defaultChildren) {
23
- var _children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
24
- var _parentProps = arguments.length > 2 ? arguments[2] : undefined;
25
- var defaultOrder = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
26
- /*
27
- * const children = React.Children.toArray(_children);
28
- * const parentProps = { ..._parentProps };
29
- */
30
- return _children.filter(function (e) {
31
- return !e.props.disabled;
32
- }) // filter the disabled components
33
- .concat(defaultChildren.filter(function (c) {
34
- return !find(children, function (component) {
35
- return isTypeEqual(component, c);
36
- });
37
- })).map(function (element) {
38
- var defaultComponent = find(defaultChildren, function (c) {
39
- return isTypeEqual(c, element);
40
- });
41
- delete parentProps.order;
42
- var defaultProps = defaultComponent ? defaultComponent.props : {};
43
- var props = _objectSpread(_objectSpread(_objectSpread({}, parentProps), defaultProps), element.props);
44
- var e = _react.React.cloneElement(element, props, element.props.children);
45
- return e;
46
- }).sort(function (a, b) {
47
- return (a.props.order || defaultOrder) - (b.props.order || defaultOrder);
48
- });
49
- }
50
-
27
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
28
+ 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); }
51
29
  /**
52
30
  * @file seconds-to-time.js
53
31
  *
@@ -63,28 +41,53 @@ function mergeAndSortChildren(defaultChildren) {
63
41
  * @function secondsToTime
64
42
  */
65
43
  function secondsToTime() {
66
- var _seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
67
- var frameRate = arguments.length > 1 ? arguments[1] : undefined;
68
- var initialTime = arguments.length > 2 ? arguments[2] : undefined;
69
- var time = '00:00:00:00';
70
- _seconds = parseFloat(_seconds);
71
- if (_seconds > -1) {
72
- if (initialTime) {
73
- _seconds += initialTime;
74
- }
75
- var date = new Date(null);
76
- var currentFrame = Math.floor(_seconds * frameRate % frameRate);
77
- var paddedFrame = currentFrame < 10 ? "0".concat(currentFrame) : currentFrame;
78
- date.setSeconds(_seconds);
79
- var timeString = date.toISOString().substr(11, 8);
80
- var timeWithFrame = "".concat(timeString, ":").concat(paddedFrame);
81
- time = timeWithFrame;
44
+ var seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
45
+ var frameRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
46
+ var initialTimecodeInSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
47
+ if (seconds > -1) {
48
+ // Calculate total frames
49
+ var totalFrames = Math.round((seconds + initialTimecodeInSeconds) * frameRate);
50
+
51
+ // Calculate new timecode
52
+ var newSeconds = Math.floor(totalFrames / frameRate);
53
+ var remainderFrames = totalFrames % frameRate;
54
+
55
+ // Calculate fractional frames within the range [0, 1)
56
+ var fractionalFrames = remainderFrames / frameRate;
57
+ var newFF = Math.floor(fractionalFrames * frameRate).toString().padStart(2, '0');
58
+ var newSS = newSeconds % 60;
59
+ var newMM = Math.floor(newSeconds / 60) % 60;
60
+ var newHH = Math.floor(newSeconds / 3600);
61
+
62
+ // Format and return the new timecode
63
+ return "".concat(newHH.toString().padStart(2, '0'), ":").concat(newMM.toString().padStart(2, '0'), ":").concat(newSS.toString().padStart(2, '0'), ":").concat(newFF);
82
64
  }
83
- return time;
65
+ return '00:00:00:00';
84
66
  }
67
+
68
+ // export function secondsToTime(_seconds = 0, frameRate, initialTime) {
69
+ // let time = '00:00:00:00';
70
+ // _seconds = parseFloat(_seconds);
71
+ // if (_seconds > -1) {
72
+ // if (initialTime) {
73
+ // _seconds += initialTime;
74
+ // }
75
+ // const date = new Date(null);
76
+ // const currentFrame = Math.round((_seconds * frameRate) % frameRate);
77
+ // const paddedFrame = currentFrame < 10 ? `0${currentFrame}` : currentFrame;
78
+ // date.setSeconds(_seconds);
79
+ // const timeString = date.toISOString().substr(11, 8);
80
+ // const timeWithFrame = `${timeString}:${paddedFrame}`;
81
+ // time = timeWithFrame;
82
+ // }
83
+
84
+ // return time;
85
+ // }
86
+
85
87
  function timeToSeconds() {
86
88
  var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '00:00:00:00';
87
89
  var frameRate = arguments.length > 1 ? arguments[1] : undefined;
90
+ if (!time) return 0;
88
91
  var timeObj = time.split(':'); // split it at the colons
89
92
 
90
93
  // minutes are worth 60 seconds. Hours are worth 60 minutes.
@@ -141,4 +144,100 @@ function formatTime() {
141
144
  // Check if leading zero is need for seconds
142
145
  s = s < 10 ? "0".concat(s) : s;
143
146
  return h + m + s;
147
+ }
148
+
149
+ /*
150
+ * Check if the element belongs to a video element
151
+ * only accept <source />, <track />,
152
+ * <MyComponent isVideoChild />
153
+ * elements
154
+ */
155
+ function isVideoChild(c) {
156
+ if (c.props && c.props.isVideoChild) {
157
+ return true;
158
+ }
159
+ return c.type === 'source' || c.type === 'track';
160
+ }
161
+ var find = function find(elements, func) {
162
+ return elements.filter(func)[0];
163
+ };
164
+
165
+ // check if two components are the same type
166
+ var isTypeEqual = function isTypeEqual(component1, component2) {
167
+ var type1 = component1.type;
168
+ var type2 = component2.type;
169
+ if (typeof type1 === 'string' || typeof type2 === 'string') {
170
+ return type1 === type2;
171
+ }
172
+ if (typeof type1 === 'function' && typeof type2 === 'function') {
173
+ return type1.displayName === type2.displayName;
174
+ }
175
+ return false;
176
+ };
177
+
178
+ /*
179
+ * merge default children
180
+ * sort them by `order` property
181
+ * filter them by `disabled` property
182
+ */
183
+ function mergeAndSortChildren(defaultChildren, _children, _parentProps) {
184
+ var defaultOrder = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
185
+ var children = _react["default"].Children.toArray(_children);
186
+ var parentProps = _objectSpread({}, _parentProps);
187
+ return children.filter(function (e) {
188
+ return !e.props.disabled;
189
+ }) // filter the disabled components
190
+ .concat(defaultChildren.filter(function (c) {
191
+ return !find(children, function (component) {
192
+ return isTypeEqual(component, c);
193
+ });
194
+ })).map(function (element) {
195
+ var defaultComponent = find(defaultChildren, function (c) {
196
+ return isTypeEqual(c, element);
197
+ });
198
+ delete parentProps.order;
199
+ var defaultProps = defaultComponent ? defaultComponent.props : {};
200
+ var props = _objectSpread(_objectSpread(_objectSpread({}, parentProps), defaultProps), element.props);
201
+ var e = /*#__PURE__*/_react["default"].cloneElement(element, props, element.props.children);
202
+ return e;
203
+ }).sort(function (a, b) {
204
+ return (a.props.order || defaultOrder) - (b.props.order || defaultOrder);
205
+ });
206
+ }
207
+
208
+ /**
209
+ * Temporary utility for generating the warnings
210
+ */
211
+ function deprecatedWarning(oldMethodCall, newMethodCall) {
212
+ // eslint-disable-next-line no-console
213
+ console.warn("WARNING: ".concat(oldMethodCall, " will be deprecated soon!\n Please use ").concat(newMethodCall, " instead."));
214
+ }
215
+ function throttle(callback, limit) {
216
+ var _arguments = arguments;
217
+ var wait = false;
218
+ return function () {
219
+ if (!wait) {
220
+ callback.apply(void 0, _toConsumableArray(_arguments));
221
+ wait = true;
222
+ setTimeout(function () {
223
+ wait = false;
224
+ }, limit);
225
+ }
226
+ };
227
+ }
228
+ var mediaProperties = exports.mediaProperties = ['error', 'src', 'srcObject', 'currentSrc', 'crossOrigin', 'networkState', 'preload', 'buffered', 'readyState', 'seeking', 'currentTime', 'duration', 'paused', 'defaultPlaybackRate', 'playbackRate', 'played', 'seekable', 'ended', 'autoplay', 'loop', 'mediaGroup', 'controller', 'controls', 'volume', 'muted', 'defaultMuted', 'audioTracks', 'videoTracks', 'textTracks', 'width', 'height', 'videoWidth', 'videoHeight', 'poster'];
229
+
230
+ /**
231
+ *
232
+ * @param {Number} currentTime current time of video
233
+ * @returns adjusting the current time to the nearest frame
234
+ */
235
+ function handleAdjustingVideoAsPerFrame(currentTime) {
236
+ var frameRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
237
+ var frameDuration = 1 / frameRate;
238
+ var milliSeconds = currentTime - Math.floor(currentTime);
239
+ var frameNumber = Math.round(milliSeconds / frameDuration);
240
+ var updatedMilliseconds = frameNumber * frameDuration;
241
+ var adjustedTimeInSeconds = Math.trunc(currentTime) + updatedMilliseconds;
242
+ return adjustedTimeInSeconds;
144
243
  }