@desynova-digital/player 4.0.74 → 4.0.75

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 (70) hide show
  1. package/Manager.js +9 -8
  2. package/actions/player.js +1 -1
  3. package/components/AudioMeter.js +28 -27
  4. package/components/BigPlayButton.js +17 -16
  5. package/components/ImageViewer.js +17 -16
  6. package/components/MarkerBar.js +17 -16
  7. package/components/Menu.js +2 -2
  8. package/components/Player.js +46 -45
  9. package/components/PlayerHeader.js +24 -23
  10. package/components/Playlist.js +15 -14
  11. package/components/PointersBar.js +20 -19
  12. package/components/PosterImage.js +1 -1
  13. package/components/SDOutline.js +2 -2
  14. package/components/Shortcut.js +70 -69
  15. package/components/Slider.js +33 -33
  16. package/components/TagsBar.js +16 -15
  17. package/components/Video.js +163 -148
  18. package/components/control-bar/AudioTracksMenuButton.js +15 -14
  19. package/components/control-bar/CameraButton.js +16 -15
  20. package/components/control-bar/CaptionControlMenuButton.js +20 -19
  21. package/components/control-bar/CommentsButton.js +17 -16
  22. package/components/control-bar/ControlBar.js +18 -17
  23. package/components/control-bar/EditorControlMenuButton.js +17 -16
  24. package/components/control-bar/ForwardControl.js +1 -1
  25. package/components/control-bar/ForwardReplayControl.js +16 -15
  26. package/components/control-bar/FullscreenToggle.js +16 -15
  27. package/components/control-bar/PlayToggle.js +16 -15
  28. package/components/control-bar/ReplayControl.js +1 -1
  29. package/components/control-bar/SettingsMenuButton.js +4 -4
  30. package/components/control-bar/SubtitleLanguagesMenuButton.js +15 -14
  31. package/components/control-bar/SubtitleMovementMenu.js +17 -16
  32. package/components/control-bar/VolumeMenuButton.js +17 -16
  33. package/components/control-bar/ZoomMenuButton.js +17 -16
  34. package/components/marking-controls/MarkInControl.js +16 -15
  35. package/components/marking-controls/MarkOutControl.js +16 -15
  36. package/components/marking-controls/MarkingAddButton.js +16 -15
  37. package/components/marking-controls/MarkingControl.js +2 -2
  38. package/components/marking-controls/MarkingDeleteButton.js +16 -15
  39. package/components/marking-controls/MarkingDuration.js +2 -2
  40. package/components/marking-controls/MarkingPreview.js +16 -15
  41. package/components/marking-controls/TimecodeFormatSelector.js +7 -7
  42. package/components/progress-bar/AudioWaveform.js +16 -15
  43. package/components/progress-bar/LoadProgressBar.js +1 -1
  44. package/components/progress-bar/MouseTimeDisplay.js +1 -1
  45. package/components/progress-bar/PlayProgressBar.js +2 -2
  46. package/components/progress-bar/ProgressControl.js +20 -19
  47. package/components/progress-bar/SeekBar.js +28 -27
  48. package/components/progress-bar/Timeline.js +15 -14
  49. package/components/settings-menu-control/CameraControl.js +3 -3
  50. package/components/settings-menu-control/ChildMenuComponent.js +29 -28
  51. package/components/settings-menu-control/ParentMenuComponent.js +18 -17
  52. package/components/settings-menu-control/PlaybackRateControl.js +16 -15
  53. package/components/settings-menu-control/SafeAreaControl.js +16 -15
  54. package/components/settings-menu-control/SettingsMenu.js +12 -12
  55. package/components/time-controls/CurrentTimeDisplay.js +7 -7
  56. package/components/time-controls/DurationDisplay.js +2 -2
  57. package/components/time-controls/TimeDivider.js +2 -2
  58. package/components/volume-control/VolumeBar.js +25 -24
  59. package/components/volume-control/VolumeControl.js +1 -1
  60. package/components/volume-control/VolumeLevel.js +2 -2
  61. package/components/zoom-control/ZoomBar.js +24 -23
  62. package/components/zoom-control/ZoomLevel.js +2 -2
  63. package/index.js +2 -2
  64. package/package.json +1 -1
  65. package/reducers/operation.js +2 -2
  66. package/reducers/player.js +2 -2
  67. package/utils/browser.js +14 -14
  68. package/utils/dom.js +18 -18
  69. package/utils/fullscreen.js +6 -5
  70. package/utils/index.js +54 -54
@@ -17,32 +17,32 @@ var _SDOutline = _interopRequireDefault(require("./SDOutline"));
17
17
  var _components = require("@desynova-digital/components/components");
18
18
  var _utils2 = require("@desynova-digital/player/utils");
19
19
  var _templateObject, _templateObject2;
20
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
21
  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); }
22
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
22
+ 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; }
23
23
  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; }
24
24
  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; }
25
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
26
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
25
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
26
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
27
  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."); }
28
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
29
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
28
+ 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); }
29
+ 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; }
30
30
  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; } }
31
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
32
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
33
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
34
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
31
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
+ 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); } }
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
35
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
36
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
37
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
36
+ 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); }
38
37
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
39
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
40
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
41
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
42
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
43
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
40
+ 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); }
41
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
+ 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; }
43
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
44
44
  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); }
45
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
45
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
46
46
  var propTypes = {
47
47
  actions: _propTypes.PropTypes.instanceOf(Object),
48
48
  player: _propTypes.PropTypes.instanceOf(Object),
@@ -113,11 +113,12 @@ var VideoBlock = _styledComponents["default"].div(_templateObject2 || (_template
113
113
  return props.HDBorder ? '"16:9 Safe Area"' : '';
114
114
  });
115
115
  var Video = exports["default"] = /*#__PURE__*/function (_Component) {
116
+ _inherits(Video, _Component);
116
117
  function Video(props) {
117
118
  var _this;
118
119
  _classCallCheck(this, Video);
119
120
  _this = _callSuper(this, Video, [props]);
120
- _defineProperty(_this, "updateAnnotateVisibility", function () {
121
+ _defineProperty(_assertThisInitialized(_this), "updateAnnotateVisibility", function () {
121
122
  if (!_this.video) return;
122
123
  var _this$props = _this.props,
123
124
  initialTime = _this$props.initialTime,
@@ -132,10 +133,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
132
133
  });
133
134
  }
134
135
  });
135
- _defineProperty(_this, "onVideoTimeUpdate", function () {
136
+ _defineProperty(_assertThisInitialized(_this), "onVideoTimeUpdate", function () {
136
137
  _this.updateAnnotateVisibility();
137
138
  });
138
- _defineProperty(_this, "buildSmoothPath", function (points, width, height) {
139
+ _defineProperty(_assertThisInitialized(_this), "buildSmoothPath", function (points, width, height) {
139
140
  if (!points || points.length < 2) return '';
140
141
  var startX = points[0].x * width;
141
142
  var startY = points[0].y * height;
@@ -154,7 +155,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
154
155
  path += " L ".concat(lastX, " ").concat(lastY);
155
156
  return path;
156
157
  });
157
- _defineProperty(_this, "getTimeData", function (time) {
158
+ _defineProperty(_assertThisInitialized(_this), "getTimeData", function (time) {
158
159
  var _this$props2 = _this.props,
159
160
  inTime = _this$props2.inTime,
160
161
  outTime = _this$props2.outTime,
@@ -209,50 +210,50 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
209
210
  watermarkInterval: -1,
210
211
  isBuffering: false,
211
212
  currentSubtitleObj: {},
212
- shouldShowAnnotate: false
213
+ shouldShowAnnotate: false,
214
+ annotationsVersion: 0
213
215
  };
214
216
  _this.video = null; // the html5 video
215
217
  _this.manager = new _Manager["default"](props.store);
216
- _this.getStyle = _this.getStyle.bind(_this);
217
- _this.getChildren = _this.getChildren.bind(_this);
218
- _this.play = _this.play.bind(_this);
219
- _this.pause = _this.pause.bind(_this);
220
- _this.seek = _this.seek.bind(_this);
221
- _this.forward = _this.forward.bind(_this);
222
- _this.replay = _this.replay.bind(_this);
223
- _this.toggleFullscreen = _this.toggleFullscreen.bind(_this);
224
- _this.getProperties = _this.getProperties.bind(_this);
225
- _this.renderChildren = _this.renderChildren.bind(_this);
226
- _this.handleLoadStart = _this.handleLoadStart.bind(_this);
227
- _this.handleCanPlay = _this.handleCanPlay.bind(_this);
228
- _this.handleCanPlayThrough = _this.handleCanPlayThrough.bind(_this);
229
- _this.handlePlay = _this.handlePlay.bind(_this);
230
- _this.handlePlaying = _this.handlePlaying.bind(_this);
231
- _this.handlePause = _this.handlePause.bind(_this);
232
- _this.handleEnded = _this.handleEnded.bind(_this);
233
- _this.handleWaiting = _this.handleWaiting.bind(_this);
234
- _this.handleSeeking = _this.handleSeeking.bind(_this);
235
- _this.handleSeeked = _this.handleSeeked.bind(_this);
236
- _this.handleFullscreenChange = _this.handleFullscreenChange.bind(_this);
237
- _this.handleError = _this.handleError.bind(_this);
238
- _this.handleSuspend = _this.handleSuspend.bind(_this);
239
- _this.handleAbort = _this.handleAbort.bind(_this);
240
- _this.handleEmptied = _this.handleEmptied.bind(_this);
241
- _this.handleStalled = _this.handleStalled.bind(_this);
242
- _this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_this);
243
- _this.handleLoadedData = _this.handleLoadedData.bind(_this);
244
- _this.handleTimeUpdate = _this.handleTimeUpdate.bind(_this);
245
- _this.handleRateChange = _this.handleRateChange.bind(_this);
246
- _this.handleVolumeChange = _this.handleVolumeChange.bind(_this);
247
- _this.handleDurationChange = _this.handleDurationChange.bind(_this);
248
- _this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_this), 250);
249
- _this.handleKeypress = _this.handleKeypress.bind(_this);
250
- _this.audioVisualizer = _this.audioVisualizer.bind(_this);
251
- _this.checkWatermark = _this.checkWatermark.bind(_this);
218
+ _this.getStyle = _this.getStyle.bind(_assertThisInitialized(_this));
219
+ _this.getChildren = _this.getChildren.bind(_assertThisInitialized(_this));
220
+ _this.play = _this.play.bind(_assertThisInitialized(_this));
221
+ _this.pause = _this.pause.bind(_assertThisInitialized(_this));
222
+ _this.seek = _this.seek.bind(_assertThisInitialized(_this));
223
+ _this.forward = _this.forward.bind(_assertThisInitialized(_this));
224
+ _this.replay = _this.replay.bind(_assertThisInitialized(_this));
225
+ _this.toggleFullscreen = _this.toggleFullscreen.bind(_assertThisInitialized(_this));
226
+ _this.getProperties = _this.getProperties.bind(_assertThisInitialized(_this));
227
+ _this.renderChildren = _this.renderChildren.bind(_assertThisInitialized(_this));
228
+ _this.handleLoadStart = _this.handleLoadStart.bind(_assertThisInitialized(_this));
229
+ _this.handleCanPlay = _this.handleCanPlay.bind(_assertThisInitialized(_this));
230
+ _this.handleCanPlayThrough = _this.handleCanPlayThrough.bind(_assertThisInitialized(_this));
231
+ _this.handlePlay = _this.handlePlay.bind(_assertThisInitialized(_this));
232
+ _this.handlePlaying = _this.handlePlaying.bind(_assertThisInitialized(_this));
233
+ _this.handlePause = _this.handlePause.bind(_assertThisInitialized(_this));
234
+ _this.handleEnded = _this.handleEnded.bind(_assertThisInitialized(_this));
235
+ _this.handleWaiting = _this.handleWaiting.bind(_assertThisInitialized(_this));
236
+ _this.handleSeeking = _this.handleSeeking.bind(_assertThisInitialized(_this));
237
+ _this.handleSeeked = _this.handleSeeked.bind(_assertThisInitialized(_this));
238
+ _this.handleFullscreenChange = _this.handleFullscreenChange.bind(_assertThisInitialized(_this));
239
+ _this.handleError = _this.handleError.bind(_assertThisInitialized(_this));
240
+ _this.handleSuspend = _this.handleSuspend.bind(_assertThisInitialized(_this));
241
+ _this.handleAbort = _this.handleAbort.bind(_assertThisInitialized(_this));
242
+ _this.handleEmptied = _this.handleEmptied.bind(_assertThisInitialized(_this));
243
+ _this.handleStalled = _this.handleStalled.bind(_assertThisInitialized(_this));
244
+ _this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_assertThisInitialized(_this));
245
+ _this.handleLoadedData = _this.handleLoadedData.bind(_assertThisInitialized(_this));
246
+ _this.handleTimeUpdate = _this.handleTimeUpdate.bind(_assertThisInitialized(_this));
247
+ _this.handleRateChange = _this.handleRateChange.bind(_assertThisInitialized(_this));
248
+ _this.handleVolumeChange = _this.handleVolumeChange.bind(_assertThisInitialized(_this));
249
+ _this.handleDurationChange = _this.handleDurationChange.bind(_assertThisInitialized(_this));
250
+ _this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_assertThisInitialized(_this)), 250);
251
+ _this.handleKeypress = _this.handleKeypress.bind(_assertThisInitialized(_this));
252
+ _this.audioVisualizer = _this.audioVisualizer.bind(_assertThisInitialized(_this));
253
+ _this.checkWatermark = _this.checkWatermark.bind(_assertThisInitialized(_this));
252
254
  return _this;
253
255
  }
254
- _inherits(Video, _Component);
255
- return _createClass(Video, [{
256
+ _createClass(Video, [{
256
257
  key: "componentDidMount",
257
258
  value: function componentDidMount() {
258
259
  var src = this.props.src;
@@ -280,9 +281,21 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
280
281
  }, {
281
282
  key: "componentDidUpdate",
282
283
  value: function componentDidUpdate(prevProps) {
284
+ var _this2 = this;
283
285
  var _this$props3 = this.props,
286
+ parentAnnotations = _this$props3.parentAnnotations,
284
287
  inTime = _this$props3.inTime,
285
288
  outTime = _this$props3.outTime;
289
+ var hasNewAnnotations = JSON.stringify(parentAnnotations) !== JSON.stringify(prevProps.parentAnnotations);
290
+ if (hasNewAnnotations) {
291
+ Promise.resolve().then(function () {
292
+ _this2.setState(function (prevState) {
293
+ return {
294
+ annotationsVersion: (prevState.annotationsVersion || 0) + 1
295
+ };
296
+ });
297
+ });
298
+ }
286
299
  if (this.props.isSvgLayer && this.props.isSvgLayer !== prevProps.isSvgLayer) {
287
300
  this.toggleViaAnnotatePlay();
288
301
  }
@@ -309,8 +322,8 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
309
322
  }, {
310
323
  key: "checkWatermark",
311
324
  value:
312
- /**
313
- * This function is triggered on interval to shuffle the position of watermark on Player area
325
+ /**
326
+ * This function is triggered on interval to shuffle the position of watermark on Player area
314
327
  */
315
328
  function checkWatermark() {
316
329
  var watermark = this.state.watermark;
@@ -348,7 +361,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
348
361
  }, {
349
362
  key: "setupHLS",
350
363
  value: function setupHLS(src) {
351
- var _this2 = this;
364
+ var _this3 = this;
352
365
  var _this$props5 = this.props,
353
366
  actions = _this$props5.actions,
354
367
  activeTrackIndex = _this$props5.activeTrackIndex;
@@ -372,18 +385,18 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
372
385
  switch (data.type) {
373
386
  case _hls["default"].ErrorTypes.NETWORK_ERROR:
374
387
  // try to recover network error
375
- _this2.hls.startLoad();
388
+ _this3.hls.startLoad();
376
389
  break;
377
390
  case _hls["default"].ErrorTypes.MEDIA_ERROR:
378
- _this2.hls.recoverMediaError();
391
+ _this3.hls.recoverMediaError();
379
392
  break;
380
393
  default:
381
394
  // cannot recover
382
- _this2.hls.destroy();
395
+ _this3.hls.destroy();
383
396
  break;
384
397
  }
385
398
  } else if (data.details === 'internalException' && data.type === 'otherError' || data.details === 'bufferStalledError' && data.type === 'mediaError') {
386
- _this2.hls.startLoad();
399
+ _this3.hls.startLoad();
387
400
  }
388
401
  });
389
402
  }
@@ -481,9 +494,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
481
494
  aspectRatio = _this$props6.aspectRatio,
482
495
  width = _this$props6.width,
483
496
  height = _this$props6.height;
484
- /*
485
- * The aspect ratio is either used directly
486
- * or to calculate width and height.
497
+ /*
498
+ * The aspect ratio is either used directly
499
+ * or to calculate width and height.
487
500
  */
488
501
  if (player.videoWidth) {
489
502
  // Otherwise try to get the aspect ratio from the video metadata
@@ -520,12 +533,12 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
520
533
  }, {
521
534
  key: "getProperties",
522
535
  value: function getProperties() {
523
- var _this3 = this;
536
+ var _this4 = this;
524
537
  if (!this.video) {
525
538
  return null;
526
539
  }
527
540
  return _utils.mediaProperties.reduce(function (properties, key) {
528
- properties[key] = _this3.video[key];
541
+ properties[key] = _this4.video[key];
529
542
  return properties;
530
543
  }, {});
531
544
  }
@@ -537,9 +550,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
537
550
  return this.video.playbackRate;
538
551
  }
539
552
 
540
- /*
541
- * set playback rate
542
- * speed of video
553
+ /*
554
+ * set playback rate
555
+ * speed of video
543
556
  */,
544
557
  set: function set(rate) {
545
558
  this.video.playbackRate = rate;
@@ -755,9 +768,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
755
768
  actions.toggleFullscreen(player);
756
769
  }
757
770
 
758
- /*
759
- * Fired when the user agent
760
- * begins looking for media data
771
+ /*
772
+ * Fired when the user agent
773
+ * begins looking for media data
761
774
  */
762
775
  }, {
763
776
  key: "handleLoadStart",
@@ -775,9 +788,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
775
788
  }
776
789
  }
777
790
 
778
- /*
779
- * A handler for events that
780
- * signal that waiting has ended
791
+ /*
792
+ * A handler for events that
793
+ * signal that waiting has ended
781
794
  */
782
795
  }, {
783
796
  key: "handleCanPlay",
@@ -791,9 +804,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
791
804
  }
792
805
  }
793
806
 
794
- /*
795
- * A handler for events that
796
- * signal that waiting has ended
807
+ /*
808
+ * A handler for events that
809
+ * signal that waiting has ended
797
810
  */
798
811
  }, {
799
812
  key: "handleCanPlayThrough",
@@ -807,9 +820,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
807
820
  }
808
821
  }
809
822
 
810
- /*
811
- * A handler for events that
812
- * signal that waiting has ended
823
+ /*
824
+ * A handler for events that
825
+ * signal that waiting has ended
813
826
  */
814
827
  }, {
815
828
  key: "handlePlaying",
@@ -849,9 +862,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
849
862
  }
850
863
  }
851
864
 
852
- /*
853
- * Fired when the duration of
854
- * the media resource is first known or changed
865
+ /*
866
+ * Fired when the duration of
867
+ * the media resource is first known or changed
855
868
  */
856
869
  }, {
857
870
  key: "handleDurationChange",
@@ -865,9 +878,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
865
878
  }
866
879
  }
867
880
 
868
- /*
869
- * Fired while the user agent
870
- * is downloading media data
881
+ /*
882
+ * Fired while the user agent
883
+ * is downloading media data
871
884
  */
872
885
  }, {
873
886
  key: "handleProgress",
@@ -934,9 +947,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
934
947
  }
935
948
  }
936
949
 
937
- /*
938
- * Fired when the end of the media resource
939
- * is reached (currentTime == duration)
950
+ /*
951
+ * Fired when the end of the media resource
952
+ * is reached (currentTime == duration)
940
953
  */
941
954
  }, {
942
955
  key: "handleEnded",
@@ -971,9 +984,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
971
984
  }
972
985
  }
973
986
 
974
- /*
975
- * Fired whenever the player
976
- * is jumping to a new time
987
+ /*
988
+ * Fired whenever the player
989
+ * is jumping to a new time
977
990
  */
978
991
  }, {
979
992
  key: "handleSeeking",
@@ -987,9 +1000,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
987
1000
  }
988
1001
  }
989
1002
 
990
- /*
991
- * Fired when the player has
992
- * finished jumping to a new time
1003
+ /*
1004
+ * Fired when the player has
1005
+ * finished jumping to a new time
993
1006
  */
994
1007
  }, {
995
1008
  key: "handleSeeked",
@@ -1008,9 +1021,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1008
1021
  key: "handleFullscreenChange",
1009
1022
  value: function handleFullscreenChange() {}
1010
1023
 
1011
- /*
1012
- * Fires when the browser is
1013
- * intentionally not getting media data
1024
+ /*
1025
+ * Fires when the browser is
1026
+ * intentionally not getting media data
1014
1027
  */
1015
1028
  }, {
1016
1029
  key: "handleSuspend",
@@ -1050,9 +1063,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1050
1063
  }
1051
1064
  }
1052
1065
 
1053
- /*
1054
- * Fires when the browser is trying to
1055
- * get media data, but data is not available
1066
+ /*
1067
+ * Fires when the browser is trying to
1068
+ * get media data, but data is not available
1056
1069
  */
1057
1070
  }, {
1058
1071
  key: "handleStalled",
@@ -1066,9 +1079,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1066
1079
  }
1067
1080
  }
1068
1081
 
1069
- /*
1070
- * Fires when the browser has loaded
1071
- * meta data for the audio/video
1082
+ /*
1083
+ * Fires when the browser has loaded
1084
+ * meta data for the audio/video
1072
1085
  */
1073
1086
  }, {
1074
1087
  key: "handleLoadedMetaData",
@@ -1086,9 +1099,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1086
1099
  }
1087
1100
  }
1088
1101
 
1089
- /*
1090
- * Fires when the browser has loaded
1091
- * the current frame of the audio/video
1102
+ /*
1103
+ * Fires when the browser has loaded
1104
+ * the current frame of the audio/video
1092
1105
  */
1093
1106
  }, {
1094
1107
  key: "handleLoadedData",
@@ -1102,9 +1115,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1102
1115
  }
1103
1116
  }
1104
1117
 
1105
- /*
1106
- * Fires when the current
1107
- * playback position has changed
1118
+ /*
1119
+ * Fires when the current
1120
+ * playback position has changed
1108
1121
  */
1109
1122
  }, {
1110
1123
  key: "handleTimeUpdate",
@@ -1135,8 +1148,8 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1135
1148
  this.displaySubtitle();
1136
1149
  }
1137
1150
 
1138
- /**
1139
- * Fires when the playing speed of the audio/video is changed
1151
+ /**
1152
+ * Fires when the playing speed of the audio/video is changed
1140
1153
  */
1141
1154
  }, {
1142
1155
  key: "handleRateChange",
@@ -1163,9 +1176,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1163
1176
  }
1164
1177
  }
1165
1178
 
1166
- /*
1167
- * Fires when an error occurred
1168
- * during the loading of an audio/video
1179
+ /*
1180
+ * Fires when an error occurred
1181
+ * during the loading of an audio/video
1169
1182
  */
1170
1183
  }, {
1171
1184
  key: "handleError",
@@ -1216,10 +1229,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1216
1229
  for (var i = 0; i < bufferLength; i++) {
1217
1230
  barHeight = dataArray[i] * 2;
1218
1231
 
1219
- /*
1220
- * var r = barHeight + (25 * (i / bufferLength));
1221
- * var g = 250 * (i / bufferLength);
1222
- * var b = s50;
1232
+ /*
1233
+ * var r = barHeight + (25 * (i / bufferLength));
1234
+ * var g = 250 * (i / bufferLength);
1235
+ * var b = s50;
1223
1236
  */
1224
1237
 
1225
1238
  ctx.fillStyle = '#0c141d'; // 'rgb(' + r + ',' + g + ',' + b + ')';
@@ -1232,7 +1245,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1232
1245
  }, {
1233
1246
  key: "renderChildren",
1234
1247
  value: function renderChildren() {
1235
- var _this4 = this;
1248
+ var _this5 = this;
1236
1249
  var props = _objectSpread(_objectSpread({}, this.props), {}, {
1237
1250
  video: this.video
1238
1251
  });
@@ -1254,7 +1267,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1254
1267
  if (preOnError) {
1255
1268
  preOnError.apply(void 0, arguments);
1256
1269
  }
1257
- _this4.handleError.apply(_this4, arguments);
1270
+ _this5.handleError.apply(_this5, arguments);
1258
1271
  };
1259
1272
  }
1260
1273
  } else {
@@ -1302,7 +1315,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1302
1315
  }, {
1303
1316
  key: "render",
1304
1317
  value: function render() {
1305
- var _this5 = this,
1318
+ var _this6 = this,
1306
1319
  _this$props$parentAnn,
1307
1320
  _this$props$parentAnn2,
1308
1321
  _this$props$parentAnn3,
@@ -1331,7 +1344,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1331
1344
  return /*#__PURE__*/_react["default"].createElement(VideoBlock, {
1332
1345
  className: "video-react-player-block",
1333
1346
  ref: function ref(c) {
1334
- _this5.playerBlock = c;
1347
+ _this6.playerBlock = c;
1335
1348
  },
1336
1349
  style: this.getStyle(),
1337
1350
  HDBorder: player.HDBorderActive,
@@ -1339,7 +1352,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1339
1352
  }, isBuffering && /*#__PURE__*/_react["default"].createElement("div", {
1340
1353
  className: "loader-container",
1341
1354
  onClick: function onClick() {
1342
- return _this5.togglePlay();
1355
+ return _this6.togglePlay();
1343
1356
  }
1344
1357
  }, /*#__PURE__*/_react["default"].createElement(_components.Loader, {
1345
1358
  theme: theme,
@@ -1347,7 +1360,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1347
1360
  })) || null, fileType === 'audio' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("canvas", {
1348
1361
  id: "canvas",
1349
1362
  ref: function ref(c) {
1350
- _this5.canvas = c;
1363
+ _this6.canvas = c;
1351
1364
  },
1352
1365
  style: {
1353
1366
  top: 0,
@@ -1358,7 +1371,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1358
1371
  id: videoId,
1359
1372
  crossOrigin: "anonymous",
1360
1373
  ref: function ref(c) {
1361
- _this5.video = c;
1374
+ _this6.video = c;
1362
1375
  },
1363
1376
  muted: muted,
1364
1377
  preload: preload,
@@ -1394,7 +1407,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1394
1407
  id: videoId,
1395
1408
  crossOrigin: crossOrigin,
1396
1409
  ref: function ref(c) {
1397
- _this5.video = c;
1410
+ _this6.video = c;
1398
1411
  },
1399
1412
  muted: muted,
1400
1413
  preload: preload,
@@ -1426,7 +1439,8 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1426
1439
  onVolumeChange: this.handleVolumeChange
1427
1440
  }, /*#__PURE__*/_react["default"].createElement("track", {
1428
1441
  kind: "captions"
1429
- }), this.renderChildren()), this.state.shouldShowAnnotate && (((_this$props$parentAnn = this.props.parentAnnotations) === null || _this$props$parentAnn === void 0 ? void 0 : _this$props$parentAnn.length) > 0 || this.props.isSvgLayer) && /*#__PURE__*/_react["default"].createElement("svg", {
1442
+ }), this.renderChildren()), this.state.shouldShowAnnotate && (((_this$props$parentAnn = this.props.parentAnnotations) === null || _this$props$parentAnn === void 0 ? void 0 : _this$props$parentAnn.length) > 0 || this.props.isSvgLayer) ? /*#__PURE__*/_react["default"].createElement("svg", {
1443
+ key: "".concat(this.state.annotationsVersion),
1430
1444
  ref: this.props.playerSvgRef,
1431
1445
  onMouseDown: this.props.handleMouseDown,
1432
1446
  onMouseMove: this.props.handleMouseMove,
@@ -1441,8 +1455,8 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1441
1455
  zIndex: 999
1442
1456
  }
1443
1457
  }, ((_this$props$parentAnn2 = this.props.parentAnnotations) === null || _this$props$parentAnn2 === void 0 ? void 0 : _this$props$parentAnn2.length) && ((_this$props$parentAnn3 = this.props.parentAnnotations) === null || _this$props$parentAnn3 === void 0 ? void 0 : _this$props$parentAnn3.map(function (ann, idx) {
1444
- var _this5$props$playerSv;
1445
- var svg = (_this5$props$playerSv = _this5.props.playerSvgRef) === null || _this5$props$playerSv === void 0 ? void 0 : _this5$props$playerSv.current;
1458
+ var _this6$props$playerSv;
1459
+ var svg = (_this6$props$playerSv = _this6.props.playerSvgRef) === null || _this6$props$playerSv === void 0 ? void 0 : _this6$props$playerSv.current;
1446
1460
  if (!svg) return null;
1447
1461
  var svgData = svg.getBoundingClientRect();
1448
1462
  var width = svgData.width;
@@ -1462,10 +1476,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1462
1476
  strokeWidth: "4",
1463
1477
  fill: "none",
1464
1478
  onMouseDown: function onMouseDown(e) {
1465
- return _this5.props.onShapeMouseDown(e, idx, ann);
1479
+ return _this6.props.onShapeMouseDown(e, idx, ann);
1466
1480
  },
1467
1481
  style: {
1468
- cursor: _this5.props.isSvgLayer ? 'move' : 'default'
1482
+ cursor: _this6.props.isSvgLayer ? 'move' : 'default'
1469
1483
  }
1470
1484
  });
1471
1485
  } else if (ann.type === 'line' || ann.type === 'arrow') {
@@ -1483,25 +1497,25 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1483
1497
  strokeWidth: "4",
1484
1498
  markerEnd: ann.type === 'arrow' ? "url(#open-arrowhead-".concat(ann.color.replace('#', ''), "-").concat(idx, ")") : undefined,
1485
1499
  onMouseDown: function onMouseDown(e) {
1486
- return _this5.props.onShapeMouseDown(e, idx, ann);
1500
+ return _this6.props.onShapeMouseDown(e, idx, ann);
1487
1501
  },
1488
1502
  style: {
1489
1503
  color: ann.color,
1490
- cursor: _this5.props.isSvgLayer ? 'move' : 'default'
1504
+ cursor: _this6.props.isSvgLayer ? 'move' : 'default'
1491
1505
  }
1492
1506
  });
1493
1507
  } else if (ann.type === 'pencil') {
1494
1508
  return /*#__PURE__*/_react["default"].createElement("path", {
1495
1509
  key: idx,
1496
- d: _this5.buildSmoothPath(ann.points, width, height),
1510
+ d: _this6.buildSmoothPath(ann.points, width, height),
1497
1511
  stroke: ann.color,
1498
1512
  strokeWidth: "4",
1499
1513
  fill: "none",
1500
1514
  onMouseDown: function onMouseDown(e) {
1501
- return _this5.props.onShapeMouseDown(e, idx, ann);
1515
+ return _this6.props.onShapeMouseDown(e, idx, ann);
1502
1516
  },
1503
1517
  style: {
1504
- cursor: _this5.props.isSvgLayer ? 'move' : 'default'
1518
+ cursor: _this6.props.isSvgLayer ? 'move' : 'default'
1505
1519
  }
1506
1520
  });
1507
1521
  }
@@ -1525,7 +1539,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1525
1539
  }));
1526
1540
  }
1527
1541
  return null;
1528
- })))), children, /*#__PURE__*/_react["default"].createElement("p", {
1542
+ }))) : null), children, /*#__PURE__*/_react["default"].createElement("p", {
1529
1543
  className: "user-name-wrapper",
1530
1544
  id: "watermark-text",
1531
1545
  style: _objectSpread({}, watermark)
@@ -1533,11 +1547,11 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1533
1547
  id: "outer",
1534
1548
  currentSubtitleObj: currentSubtitleObj,
1535
1549
  onClick: function onClick() {
1536
- return _this5.handleSubtitleContainerClick();
1550
+ return _this6.handleSubtitleContainerClick();
1537
1551
  }
1538
1552
  }, /*#__PURE__*/_react["default"].createElement("span", {
1539
1553
  onClick: function onClick(e) {
1540
- return _this5.handleSubtitleClick(e);
1554
+ return _this6.handleSubtitleClick(e);
1541
1555
  },
1542
1556
  className: "subtitleContainer longSubtitleStyles",
1543
1557
  style: _objectSpread({}, currentSubtitleObj.style)
@@ -1559,6 +1573,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1559
1573
  }) || null)));
1560
1574
  }
1561
1575
  }]);
1576
+ return Video;
1562
1577
  }(_react.Component);
1563
1578
  Video.propTypes = propTypes;
1564
1579
  Video.defaultProps = defaultProps;