@desynova-digital/player 4.0.73 → 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 +295 -275
  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,12 +113,18 @@ 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;
123
+ var _this$props = _this.props,
124
+ initialTime = _this$props.initialTime,
125
+ frameRate = _this$props.frameRate;
126
+ var currentFormattedTime = (0, _utils.secondsToTime)(_this.video.currentTime, frameRate, initialTime);
127
+ if (currentFormattedTime) _this.props.onAutoScroll(currentFormattedTime);
122
128
  var _this$getTimeData = _this.getTimeData(_this.video.currentTime),
123
129
  shouldShow = _this$getTimeData.shouldShow;
124
130
  if (_this.state.shouldShowAnnotate !== shouldShow) {
@@ -127,10 +133,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
127
133
  });
128
134
  }
129
135
  });
130
- _defineProperty(_this, "onVideoTimeUpdate", function () {
136
+ _defineProperty(_assertThisInitialized(_this), "onVideoTimeUpdate", function () {
131
137
  _this.updateAnnotateVisibility();
132
138
  });
133
- _defineProperty(_this, "buildSmoothPath", function (points, width, height) {
139
+ _defineProperty(_assertThisInitialized(_this), "buildSmoothPath", function (points, width, height) {
134
140
  if (!points || points.length < 2) return '';
135
141
  var startX = points[0].x * width;
136
142
  var startY = points[0].y * height;
@@ -149,12 +155,12 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
149
155
  path += " L ".concat(lastX, " ").concat(lastY);
150
156
  return path;
151
157
  });
152
- _defineProperty(_this, "getTimeData", function (time) {
153
- var _this$props = _this.props,
154
- inTime = _this$props.inTime,
155
- outTime = _this$props.outTime,
156
- initialTime = _this$props.initialTime,
157
- frameRate = _this$props.frameRate;
158
+ _defineProperty(_assertThisInitialized(_this), "getTimeData", function (time) {
159
+ var _this$props2 = _this.props,
160
+ inTime = _this$props2.inTime,
161
+ outTime = _this$props2.outTime,
162
+ initialTime = _this$props2.initialTime,
163
+ frameRate = _this$props2.frameRate;
158
164
  var currentFormattedTime = (0, _utils.secondsToTime)(time, frameRate, initialTime);
159
165
  var timecodeToSeconds = function timecodeToSeconds(tc) {
160
166
  if (!tc || tc === '-1') return null;
@@ -204,50 +210,50 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
204
210
  watermarkInterval: -1,
205
211
  isBuffering: false,
206
212
  currentSubtitleObj: {},
207
- shouldShowAnnotate: false
213
+ shouldShowAnnotate: false,
214
+ annotationsVersion: 0
208
215
  };
209
216
  _this.video = null; // the html5 video
210
217
  _this.manager = new _Manager["default"](props.store);
211
- _this.getStyle = _this.getStyle.bind(_this);
212
- _this.getChildren = _this.getChildren.bind(_this);
213
- _this.play = _this.play.bind(_this);
214
- _this.pause = _this.pause.bind(_this);
215
- _this.seek = _this.seek.bind(_this);
216
- _this.forward = _this.forward.bind(_this);
217
- _this.replay = _this.replay.bind(_this);
218
- _this.toggleFullscreen = _this.toggleFullscreen.bind(_this);
219
- _this.getProperties = _this.getProperties.bind(_this);
220
- _this.renderChildren = _this.renderChildren.bind(_this);
221
- _this.handleLoadStart = _this.handleLoadStart.bind(_this);
222
- _this.handleCanPlay = _this.handleCanPlay.bind(_this);
223
- _this.handleCanPlayThrough = _this.handleCanPlayThrough.bind(_this);
224
- _this.handlePlay = _this.handlePlay.bind(_this);
225
- _this.handlePlaying = _this.handlePlaying.bind(_this);
226
- _this.handlePause = _this.handlePause.bind(_this);
227
- _this.handleEnded = _this.handleEnded.bind(_this);
228
- _this.handleWaiting = _this.handleWaiting.bind(_this);
229
- _this.handleSeeking = _this.handleSeeking.bind(_this);
230
- _this.handleSeeked = _this.handleSeeked.bind(_this);
231
- _this.handleFullscreenChange = _this.handleFullscreenChange.bind(_this);
232
- _this.handleError = _this.handleError.bind(_this);
233
- _this.handleSuspend = _this.handleSuspend.bind(_this);
234
- _this.handleAbort = _this.handleAbort.bind(_this);
235
- _this.handleEmptied = _this.handleEmptied.bind(_this);
236
- _this.handleStalled = _this.handleStalled.bind(_this);
237
- _this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_this);
238
- _this.handleLoadedData = _this.handleLoadedData.bind(_this);
239
- _this.handleTimeUpdate = _this.handleTimeUpdate.bind(_this);
240
- _this.handleRateChange = _this.handleRateChange.bind(_this);
241
- _this.handleVolumeChange = _this.handleVolumeChange.bind(_this);
242
- _this.handleDurationChange = _this.handleDurationChange.bind(_this);
243
- _this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_this), 250);
244
- _this.handleKeypress = _this.handleKeypress.bind(_this);
245
- _this.audioVisualizer = _this.audioVisualizer.bind(_this);
246
- _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));
247
254
  return _this;
248
255
  }
249
- _inherits(Video, _Component);
250
- return _createClass(Video, [{
256
+ _createClass(Video, [{
251
257
  key: "componentDidMount",
252
258
  value: function componentDidMount() {
253
259
  var src = this.props.src;
@@ -275,9 +281,21 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
275
281
  }, {
276
282
  key: "componentDidUpdate",
277
283
  value: function componentDidUpdate(prevProps) {
278
- var _this$props2 = this.props,
279
- inTime = _this$props2.inTime,
280
- outTime = _this$props2.outTime;
284
+ var _this2 = this;
285
+ var _this$props3 = this.props,
286
+ parentAnnotations = _this$props3.parentAnnotations,
287
+ inTime = _this$props3.inTime,
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
+ }
281
299
  if (this.props.isSvgLayer && this.props.isSvgLayer !== prevProps.isSvgLayer) {
282
300
  this.toggleViaAnnotatePlay();
283
301
  }
@@ -304,14 +322,14 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
304
322
  }, {
305
323
  key: "checkWatermark",
306
324
  value:
307
- /**
308
- * 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
309
327
  */
310
328
  function checkWatermark() {
311
329
  var watermark = this.state.watermark;
312
- var _this$props3 = this.props,
313
- onPlayerClose = _this$props3.onPlayerClose,
314
- userEmail = _this$props3.userEmail;
330
+ var _this$props4 = this.props,
331
+ onPlayerClose = _this$props4.onPlayerClose,
332
+ userEmail = _this$props4.userEmail;
315
333
  var watermark_text = document.querySelector('#watermark-text');
316
334
  var video_player = null;
317
335
  var watermark_dimension = null;
@@ -343,10 +361,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
343
361
  }, {
344
362
  key: "setupHLS",
345
363
  value: function setupHLS(src) {
346
- var _this2 = this;
347
- var _this$props4 = this.props,
348
- actions = _this$props4.actions,
349
- activeTrackIndex = _this$props4.activeTrackIndex;
364
+ var _this3 = this;
365
+ var _this$props5 = this.props,
366
+ actions = _this$props5.actions,
367
+ activeTrackIndex = _this$props5.activeTrackIndex;
350
368
  var self = this;
351
369
  // bind them together
352
370
  this.hls.attachMedia(this.video);
@@ -367,18 +385,18 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
367
385
  switch (data.type) {
368
386
  case _hls["default"].ErrorTypes.NETWORK_ERROR:
369
387
  // try to recover network error
370
- _this2.hls.startLoad();
388
+ _this3.hls.startLoad();
371
389
  break;
372
390
  case _hls["default"].ErrorTypes.MEDIA_ERROR:
373
- _this2.hls.recoverMediaError();
391
+ _this3.hls.recoverMediaError();
374
392
  break;
375
393
  default:
376
394
  // cannot recover
377
- _this2.hls.destroy();
395
+ _this3.hls.destroy();
378
396
  break;
379
397
  }
380
398
  } else if (data.details === 'internalException' && data.type === 'otherError' || data.details === 'bufferStalledError' && data.type === 'mediaError') {
381
- _this2.hls.startLoad();
399
+ _this3.hls.startLoad();
382
400
  }
383
401
  });
384
402
  }
@@ -472,13 +490,13 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
472
490
  var _this$manager$getStat2 = this.manager.getState(),
473
491
  player = _this$manager$getStat2.player;
474
492
  var style = {};
475
- var _this$props5 = this.props,
476
- aspectRatio = _this$props5.aspectRatio,
477
- width = _this$props5.width,
478
- height = _this$props5.height;
479
- /*
480
- * The aspect ratio is either used directly
481
- * or to calculate width and height.
493
+ var _this$props6 = this.props,
494
+ aspectRatio = _this$props6.aspectRatio,
495
+ width = _this$props6.width,
496
+ height = _this$props6.height;
497
+ /*
498
+ * The aspect ratio is either used directly
499
+ * or to calculate width and height.
482
500
  */
483
501
  if (player.videoWidth) {
484
502
  // Otherwise try to get the aspect ratio from the video metadata
@@ -515,12 +533,12 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
515
533
  }, {
516
534
  key: "getProperties",
517
535
  value: function getProperties() {
518
- var _this3 = this;
536
+ var _this4 = this;
519
537
  if (!this.video) {
520
538
  return null;
521
539
  }
522
540
  return _utils.mediaProperties.reduce(function (properties, key) {
523
- properties[key] = _this3.video[key];
541
+ properties[key] = _this4.video[key];
524
542
  return properties;
525
543
  }, {});
526
544
  }
@@ -532,9 +550,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
532
550
  return this.video.playbackRate;
533
551
  }
534
552
 
535
- /*
536
- * set playback rate
537
- * speed of video
553
+ /*
554
+ * set playback rate
555
+ * speed of video
538
556
  */,
539
557
  set: function set(rate) {
540
558
  this.video.playbackRate = rate;
@@ -578,12 +596,12 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
578
596
  }, {
579
597
  key: "UNSAFE_componentWillReceiveProps",
580
598
  value: function UNSAFE_componentWillReceiveProps(newProps) {
581
- var _this$props6 = this.props,
582
- src = _this$props6.src,
583
- activeAudio = _this$props6.player.activeAudio,
584
- currentSubtitleObj = _this$props6.currentSubtitleObj,
585
- markers = _this$props6.markers,
586
- playerType = _this$props6.playerType;
599
+ var _this$props7 = this.props,
600
+ src = _this$props7.src,
601
+ activeAudio = _this$props7.player.activeAudio,
602
+ currentSubtitleObj = _this$props7.currentSubtitleObj,
603
+ markers = _this$props7.markers,
604
+ playerType = _this$props7.playerType;
587
605
  if (markers && markers !== newProps.markers && newProps.markers) {
588
606
  this.displaySubtitle(newProps.markers);
589
607
  }
@@ -744,23 +762,23 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
744
762
  }, {
745
763
  key: "toggleFullscreen",
746
764
  value: function toggleFullscreen() {
747
- var _this$props7 = this.props,
748
- player = _this$props7.player,
749
- actions = _this$props7.actions;
765
+ var _this$props8 = this.props,
766
+ player = _this$props8.player,
767
+ actions = _this$props8.actions;
750
768
  actions.toggleFullscreen(player);
751
769
  }
752
770
 
753
- /*
754
- * Fired when the user agent
755
- * begins looking for media data
771
+ /*
772
+ * Fired when the user agent
773
+ * begins looking for media data
756
774
  */
757
775
  }, {
758
776
  key: "handleLoadStart",
759
777
  value: function handleLoadStart() {
760
- var _this$props8 = this.props,
761
- actions = _this$props8.actions,
762
- onLoadStart = _this$props8.onLoadStart,
763
- fileType = _this$props8.fileType;
778
+ var _this$props9 = this.props,
779
+ actions = _this$props9.actions,
780
+ onLoadStart = _this$props9.onLoadStart,
781
+ fileType = _this$props9.fileType;
764
782
  if (fileType === 'audio') {
765
783
  this.audioVisualizer();
766
784
  }
@@ -770,48 +788,48 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
770
788
  }
771
789
  }
772
790
 
773
- /*
774
- * A handler for events that
775
- * signal that waiting has ended
791
+ /*
792
+ * A handler for events that
793
+ * signal that waiting has ended
776
794
  */
777
795
  }, {
778
796
  key: "handleCanPlay",
779
797
  value: function handleCanPlay() {
780
- var _this$props9 = this.props,
781
- actions = _this$props9.actions,
782
- onCanPlay = _this$props9.onCanPlay;
798
+ var _this$props10 = this.props,
799
+ actions = _this$props10.actions,
800
+ onCanPlay = _this$props10.onCanPlay;
783
801
  actions.handleCanPlay(this.getProperties());
784
802
  if (onCanPlay) {
785
803
  onCanPlay.apply(void 0, arguments);
786
804
  }
787
805
  }
788
806
 
789
- /*
790
- * A handler for events that
791
- * signal that waiting has ended
807
+ /*
808
+ * A handler for events that
809
+ * signal that waiting has ended
792
810
  */
793
811
  }, {
794
812
  key: "handleCanPlayThrough",
795
813
  value: function handleCanPlayThrough() {
796
- var _this$props10 = this.props,
797
- actions = _this$props10.actions,
798
- onCanPlayThrough = _this$props10.onCanPlayThrough;
814
+ var _this$props11 = this.props,
815
+ actions = _this$props11.actions,
816
+ onCanPlayThrough = _this$props11.onCanPlayThrough;
799
817
  actions.handleCanPlayThrough(this.getProperties());
800
818
  if (onCanPlayThrough) {
801
819
  onCanPlayThrough.apply(void 0, arguments);
802
820
  }
803
821
  }
804
822
 
805
- /*
806
- * A handler for events that
807
- * signal that waiting has ended
823
+ /*
824
+ * A handler for events that
825
+ * signal that waiting has ended
808
826
  */
809
827
  }, {
810
828
  key: "handlePlaying",
811
829
  value: function handlePlaying() {
812
- var _this$props11 = this.props,
813
- actions = _this$props11.actions,
814
- onPlaying = _this$props11.onPlaying;
830
+ var _this$props12 = this.props,
831
+ actions = _this$props12.actions,
832
+ onPlaying = _this$props12.onPlaying;
815
833
  actions.handlePlaying(this.getProperties());
816
834
  if (onPlaying) {
817
835
  onPlaying.apply(void 0, arguments);
@@ -822,9 +840,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
822
840
  }, {
823
841
  key: "handlePlay",
824
842
  value: function handlePlay() {
825
- var _this$props12 = this.props,
826
- actions = _this$props12.actions,
827
- onPlay = _this$props12.onPlay;
843
+ var _this$props13 = this.props,
844
+ actions = _this$props13.actions,
845
+ onPlay = _this$props13.onPlay;
828
846
  actions.handlePlay(this.getProperties());
829
847
  if (onPlay) {
830
848
  onPlay.apply(void 0, arguments);
@@ -835,41 +853,41 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
835
853
  }, {
836
854
  key: "handlePause",
837
855
  value: function handlePause() {
838
- var _this$props13 = this.props,
839
- actions = _this$props13.actions,
840
- onPause = _this$props13.onPause;
856
+ var _this$props14 = this.props,
857
+ actions = _this$props14.actions,
858
+ onPause = _this$props14.onPause;
841
859
  actions.handlePause(this.getProperties());
842
860
  if (onPause) {
843
861
  onPause.apply(void 0, arguments);
844
862
  }
845
863
  }
846
864
 
847
- /*
848
- * Fired when the duration of
849
- * the media resource is first known or changed
865
+ /*
866
+ * Fired when the duration of
867
+ * the media resource is first known or changed
850
868
  */
851
869
  }, {
852
870
  key: "handleDurationChange",
853
871
  value: function handleDurationChange() {
854
- var _this$props14 = this.props,
855
- actions = _this$props14.actions,
856
- onDurationChange = _this$props14.onDurationChange;
872
+ var _this$props15 = this.props,
873
+ actions = _this$props15.actions,
874
+ onDurationChange = _this$props15.onDurationChange;
857
875
  actions.handleDurationChange(this.getProperties());
858
876
  if (onDurationChange) {
859
877
  onDurationChange.apply(void 0, arguments);
860
878
  }
861
879
  }
862
880
 
863
- /*
864
- * Fired while the user agent
865
- * is downloading media data
881
+ /*
882
+ * Fired while the user agent
883
+ * is downloading media data
866
884
  */
867
885
  }, {
868
886
  key: "handleProgress",
869
887
  value: function handleProgress() {
870
- var _this$props15 = this.props,
871
- actions = _this$props15.actions,
872
- onProgress = _this$props15.onProgress;
888
+ var _this$props16 = this.props,
889
+ actions = _this$props16.actions,
890
+ onProgress = _this$props16.onProgress;
873
891
  if (this.video) {
874
892
  actions.handleProgressChange(this.getProperties());
875
893
  }
@@ -890,11 +908,11 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
890
908
  }, {
891
909
  key: "displaySubtitle",
892
910
  value: function displaySubtitle(marker) {
893
- var _this$props16 = this.props,
894
- markers = _this$props16.markers,
895
- resetSubtitleData = _this$props16.resetSubtitleData,
896
- subtitleReadOnly = _this$props16.subtitleReadOnly,
897
- subtitleDataList = _this$props16.subtitleDataList;
911
+ var _this$props17 = this.props,
912
+ markers = _this$props17.markers,
913
+ resetSubtitleData = _this$props17.resetSubtitleData,
914
+ subtitleReadOnly = _this$props17.subtitleReadOnly,
915
+ subtitleDataList = _this$props17.subtitleDataList;
898
916
  var currentSubtitleObj = this.state.currentSubtitleObj;
899
917
  if (resetSubtitleData) {
900
918
  resetSubtitleData();
@@ -929,18 +947,18 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
929
947
  }
930
948
  }
931
949
 
932
- /*
933
- * Fired when the end of the media resource
934
- * is reached (currentTime == duration)
950
+ /*
951
+ * Fired when the end of the media resource
952
+ * is reached (currentTime == duration)
935
953
  */
936
954
  }, {
937
955
  key: "handleEnded",
938
956
  value: function handleEnded() {
939
- var _this$props17 = this.props,
940
- loop = _this$props17.loop,
941
- player = _this$props17.player,
942
- actions = _this$props17.actions,
943
- onEnded = _this$props17.onEnded;
957
+ var _this$props18 = this.props,
958
+ loop = _this$props18.loop,
959
+ player = _this$props18.player,
960
+ actions = _this$props18.actions,
961
+ onEnded = _this$props18.onEnded;
944
962
  if (loop) {
945
963
  this.seek(0);
946
964
  this.play();
@@ -957,41 +975,41 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
957
975
  }, {
958
976
  key: "handleWaiting",
959
977
  value: function handleWaiting() {
960
- var _this$props18 = this.props,
961
- actions = _this$props18.actions,
962
- onWaiting = _this$props18.onWaiting;
978
+ var _this$props19 = this.props,
979
+ actions = _this$props19.actions,
980
+ onWaiting = _this$props19.onWaiting;
963
981
  actions.handleWaiting(this.getProperties());
964
982
  if (onWaiting) {
965
983
  onWaiting.apply(void 0, arguments);
966
984
  }
967
985
  }
968
986
 
969
- /*
970
- * Fired whenever the player
971
- * is jumping to a new time
987
+ /*
988
+ * Fired whenever the player
989
+ * is jumping to a new time
972
990
  */
973
991
  }, {
974
992
  key: "handleSeeking",
975
993
  value: function handleSeeking() {
976
- var _this$props19 = this.props,
977
- actions = _this$props19.actions,
978
- onSeeking = _this$props19.onSeeking;
994
+ var _this$props20 = this.props,
995
+ actions = _this$props20.actions,
996
+ onSeeking = _this$props20.onSeeking;
979
997
  actions.handleSeeking(this.getProperties());
980
998
  if (onSeeking) {
981
999
  onSeeking.apply(void 0, arguments);
982
1000
  }
983
1001
  }
984
1002
 
985
- /*
986
- * Fired when the player has
987
- * finished jumping to a new time
1003
+ /*
1004
+ * Fired when the player has
1005
+ * finished jumping to a new time
988
1006
  */
989
1007
  }, {
990
1008
  key: "handleSeeked",
991
1009
  value: function handleSeeked() {
992
- var _this$props20 = this.props,
993
- actions = _this$props20.actions,
994
- onSeeked = _this$props20.onSeeked;
1010
+ var _this$props21 = this.props,
1011
+ actions = _this$props21.actions,
1012
+ onSeeked = _this$props21.onSeeked;
995
1013
  actions.handleSeeked(this.getProperties());
996
1014
  if (onSeeked) {
997
1015
  onSeeked.apply(void 0, arguments);
@@ -1003,16 +1021,16 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1003
1021
  key: "handleFullscreenChange",
1004
1022
  value: function handleFullscreenChange() {}
1005
1023
 
1006
- /*
1007
- * Fires when the browser is
1008
- * intentionally not getting media data
1024
+ /*
1025
+ * Fires when the browser is
1026
+ * intentionally not getting media data
1009
1027
  */
1010
1028
  }, {
1011
1029
  key: "handleSuspend",
1012
1030
  value: function handleSuspend() {
1013
- var _this$props21 = this.props,
1014
- actions = _this$props21.actions,
1015
- onSuspend = _this$props21.onSuspend;
1031
+ var _this$props22 = this.props,
1032
+ actions = _this$props22.actions,
1033
+ onSuspend = _this$props22.onSuspend;
1016
1034
  actions.handleSuspend(this.getProperties());
1017
1035
  if (onSuspend) {
1018
1036
  onSuspend.apply(void 0, arguments);
@@ -1023,9 +1041,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1023
1041
  }, {
1024
1042
  key: "handleAbort",
1025
1043
  value: function handleAbort() {
1026
- var _this$props22 = this.props,
1027
- actions = _this$props22.actions,
1028
- onAbort = _this$props22.onAbort;
1044
+ var _this$props23 = this.props,
1045
+ actions = _this$props23.actions,
1046
+ onAbort = _this$props23.onAbort;
1029
1047
  actions.handleAbort(this.getProperties());
1030
1048
  if (onAbort) {
1031
1049
  onAbort.apply(void 0, arguments);
@@ -1036,42 +1054,42 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1036
1054
  }, {
1037
1055
  key: "handleEmptied",
1038
1056
  value: function handleEmptied() {
1039
- var _this$props23 = this.props,
1040
- actions = _this$props23.actions,
1041
- onEmptied = _this$props23.onEmptied;
1057
+ var _this$props24 = this.props,
1058
+ actions = _this$props24.actions,
1059
+ onEmptied = _this$props24.onEmptied;
1042
1060
  actions.handleEmptied(this.getProperties());
1043
1061
  if (onEmptied) {
1044
1062
  onEmptied.apply(void 0, arguments);
1045
1063
  }
1046
1064
  }
1047
1065
 
1048
- /*
1049
- * Fires when the browser is trying to
1050
- * 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
1051
1069
  */
1052
1070
  }, {
1053
1071
  key: "handleStalled",
1054
1072
  value: function handleStalled() {
1055
- var _this$props24 = this.props,
1056
- actions = _this$props24.actions,
1057
- onStalled = _this$props24.onStalled;
1073
+ var _this$props25 = this.props,
1074
+ actions = _this$props25.actions,
1075
+ onStalled = _this$props25.onStalled;
1058
1076
  actions.handleStalled(this.getProperties());
1059
1077
  if (onStalled) {
1060
1078
  onStalled.apply(void 0, arguments);
1061
1079
  }
1062
1080
  }
1063
1081
 
1064
- /*
1065
- * Fires when the browser has loaded
1066
- * meta data for the audio/video
1082
+ /*
1083
+ * Fires when the browser has loaded
1084
+ * meta data for the audio/video
1067
1085
  */
1068
1086
  }, {
1069
1087
  key: "handleLoadedMetaData",
1070
1088
  value: function handleLoadedMetaData() {
1071
- var _this$props25 = this.props,
1072
- actions = _this$props25.actions,
1073
- onLoadedMetadata = _this$props25.onLoadedMetadata,
1074
- startTime = _this$props25.startTime;
1089
+ var _this$props26 = this.props,
1090
+ actions = _this$props26.actions,
1091
+ onLoadedMetadata = _this$props26.onLoadedMetadata,
1092
+ startTime = _this$props26.startTime;
1075
1093
  if (startTime && startTime > 0) {
1076
1094
  this.video.currentTime = startTime;
1077
1095
  }
@@ -1081,34 +1099,34 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1081
1099
  }
1082
1100
  }
1083
1101
 
1084
- /*
1085
- * Fires when the browser has loaded
1086
- * the current frame of the audio/video
1102
+ /*
1103
+ * Fires when the browser has loaded
1104
+ * the current frame of the audio/video
1087
1105
  */
1088
1106
  }, {
1089
1107
  key: "handleLoadedData",
1090
1108
  value: function handleLoadedData() {
1091
- var _this$props26 = this.props,
1092
- actions = _this$props26.actions,
1093
- onLoadedData = _this$props26.onLoadedData;
1109
+ var _this$props27 = this.props,
1110
+ actions = _this$props27.actions,
1111
+ onLoadedData = _this$props27.onLoadedData;
1094
1112
  actions.handleLoadedData(this.getProperties());
1095
1113
  if (onLoadedData) {
1096
1114
  onLoadedData.apply(void 0, arguments);
1097
1115
  }
1098
1116
  }
1099
1117
 
1100
- /*
1101
- * Fires when the current
1102
- * playback position has changed
1118
+ /*
1119
+ * Fires when the current
1120
+ * playback position has changed
1103
1121
  */
1104
1122
  }, {
1105
1123
  key: "handleTimeUpdate",
1106
1124
  value: function handleTimeUpdate() {
1107
- var _this$props27 = this.props,
1108
- previewActive = _this$props27.player.previewActive,
1109
- actions = _this$props27.actions,
1110
- onTimeUpdate = _this$props27.onTimeUpdate,
1111
- rightMarker = _this$props27.playerSelectedMarker.rightMarker;
1125
+ var _this$props28 = this.props,
1126
+ previewActive = _this$props28.player.previewActive,
1127
+ actions = _this$props28.actions,
1128
+ onTimeUpdate = _this$props28.onTimeUpdate,
1129
+ rightMarker = _this$props28.playerSelectedMarker.rightMarker;
1112
1130
 
1113
1131
  //for annotation time updataton for svg
1114
1132
  var _this$getTimeData3 = this.getTimeData(this.video.currentTime),
@@ -1130,15 +1148,15 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1130
1148
  this.displaySubtitle();
1131
1149
  }
1132
1150
 
1133
- /**
1134
- * Fires when the playing speed of the audio/video is changed
1151
+ /**
1152
+ * Fires when the playing speed of the audio/video is changed
1135
1153
  */
1136
1154
  }, {
1137
1155
  key: "handleRateChange",
1138
1156
  value: function handleRateChange() {
1139
- var _this$props28 = this.props,
1140
- actions = _this$props28.actions,
1141
- onRateChange = _this$props28.onRateChange;
1157
+ var _this$props29 = this.props,
1158
+ actions = _this$props29.actions,
1159
+ onRateChange = _this$props29.onRateChange;
1142
1160
  actions.handleRateChange(this.getProperties());
1143
1161
  if (onRateChange) {
1144
1162
  onRateChange.apply(void 0, arguments);
@@ -1149,25 +1167,25 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1149
1167
  }, {
1150
1168
  key: "handleVolumeChange",
1151
1169
  value: function handleVolumeChange() {
1152
- var _this$props29 = this.props,
1153
- actions = _this$props29.actions,
1154
- onVolumeChange = _this$props29.onVolumeChange;
1170
+ var _this$props30 = this.props,
1171
+ actions = _this$props30.actions,
1172
+ onVolumeChange = _this$props30.onVolumeChange;
1155
1173
  actions.handleVolumeChange(this.getProperties());
1156
1174
  if (onVolumeChange) {
1157
1175
  onVolumeChange.apply(void 0, arguments);
1158
1176
  }
1159
1177
  }
1160
1178
 
1161
- /*
1162
- * Fires when an error occurred
1163
- * during the loading of an audio/video
1179
+ /*
1180
+ * Fires when an error occurred
1181
+ * during the loading of an audio/video
1164
1182
  */
1165
1183
  }, {
1166
1184
  key: "handleError",
1167
1185
  value: function handleError() {
1168
- var _this$props30 = this.props,
1169
- actions = _this$props30.actions,
1170
- onError = _this$props30.onError;
1186
+ var _this$props31 = this.props,
1187
+ actions = _this$props31.actions,
1188
+ onError = _this$props31.onError;
1171
1189
  actions.handleError(this.getProperties());
1172
1190
  if (onError) {
1173
1191
  onError.apply(void 0, arguments);
@@ -1211,10 +1229,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1211
1229
  for (var i = 0; i < bufferLength; i++) {
1212
1230
  barHeight = dataArray[i] * 2;
1213
1231
 
1214
- /*
1215
- * var r = barHeight + (25 * (i / bufferLength));
1216
- * var g = 250 * (i / bufferLength);
1217
- * var b = s50;
1232
+ /*
1233
+ * var r = barHeight + (25 * (i / bufferLength));
1234
+ * var g = 250 * (i / bufferLength);
1235
+ * var b = s50;
1218
1236
  */
1219
1237
 
1220
1238
  ctx.fillStyle = '#0c141d'; // 'rgb(' + r + ',' + g + ',' + b + ')';
@@ -1227,7 +1245,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1227
1245
  }, {
1228
1246
  key: "renderChildren",
1229
1247
  value: function renderChildren() {
1230
- var _this4 = this;
1248
+ var _this5 = this;
1231
1249
  var props = _objectSpread(_objectSpread({}, this.props), {}, {
1232
1250
  video: this.video
1233
1251
  });
@@ -1249,7 +1267,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1249
1267
  if (preOnError) {
1250
1268
  preOnError.apply(void 0, arguments);
1251
1269
  }
1252
- _this4.handleError.apply(_this4, arguments);
1270
+ _this5.handleError.apply(_this5, arguments);
1253
1271
  };
1254
1272
  }
1255
1273
  } else {
@@ -1261,9 +1279,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1261
1279
  }, {
1262
1280
  key: "handleSubtitleContainerClick",
1263
1281
  value: function handleSubtitleContainerClick() {
1264
- var _this$props31 = this.props,
1265
- actions = _this$props31.actions,
1266
- player = _this$props31.player;
1282
+ var _this$props32 = this.props,
1283
+ actions = _this$props32.actions,
1284
+ player = _this$props32.player;
1267
1285
  if (player.paused) {
1268
1286
  actions.play();
1269
1287
  } else {
@@ -1273,11 +1291,11 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1273
1291
  }, {
1274
1292
  key: "handleSubtitleClick",
1275
1293
  value: function handleSubtitleClick(e) {
1276
- var _this$props32 = this.props,
1277
- actions = _this$props32.actions,
1278
- player = _this$props32.player,
1279
- onScreenSubtitleClick = _this$props32.onScreenSubtitleClick,
1280
- controlType = _this$props32.controlType;
1294
+ var _this$props33 = this.props,
1295
+ actions = _this$props33.actions,
1296
+ player = _this$props33.player,
1297
+ onScreenSubtitleClick = _this$props33.onScreenSubtitleClick,
1298
+ controlType = _this$props33.controlType;
1281
1299
  var currentSubtitleObj = this.state.currentSubtitleObj;
1282
1300
  if (controlType === 'advanced') {
1283
1301
  if (onScreenSubtitleClick) {
@@ -1297,26 +1315,26 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1297
1315
  }, {
1298
1316
  key: "render",
1299
1317
  value: function render() {
1300
- var _this5 = this,
1318
+ var _this6 = this,
1301
1319
  _this$props$parentAnn,
1302
1320
  _this$props$parentAnn2,
1303
1321
  _this$props$parentAnn3,
1304
1322
  _this$props$parentAnn4;
1305
- var _this$props33 = this.props,
1306
- loop = _this$props33.loop,
1307
- poster = _this$props33.poster,
1308
- preload = _this$props33.preload,
1309
- autoPlay = _this$props33.autoPlay,
1310
- playsInline = _this$props33.playsInline,
1311
- muted = _this$props33.muted,
1312
- crossOrigin = _this$props33.crossOrigin,
1313
- videoId = _this$props33.videoId,
1314
- fileType = _this$props33.fileType,
1315
- userEmail = _this$props33.userEmail,
1316
- theme = _this$props33.theme,
1317
- player = _this$props33.player,
1318
- playerType = _this$props33.playerType,
1319
- markers = _this$props33.markers;
1323
+ var _this$props34 = this.props,
1324
+ loop = _this$props34.loop,
1325
+ poster = _this$props34.poster,
1326
+ preload = _this$props34.preload,
1327
+ autoPlay = _this$props34.autoPlay,
1328
+ playsInline = _this$props34.playsInline,
1329
+ muted = _this$props34.muted,
1330
+ crossOrigin = _this$props34.crossOrigin,
1331
+ videoId = _this$props34.videoId,
1332
+ fileType = _this$props34.fileType,
1333
+ userEmail = _this$props34.userEmail,
1334
+ theme = _this$props34.theme,
1335
+ player = _this$props34.player,
1336
+ playerType = _this$props34.playerType,
1337
+ markers = _this$props34.markers;
1320
1338
  var _this$state2 = this.state,
1321
1339
  isBuffering = _this$state2.isBuffering,
1322
1340
  watermark = _this$state2.watermark,
@@ -1326,7 +1344,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1326
1344
  return /*#__PURE__*/_react["default"].createElement(VideoBlock, {
1327
1345
  className: "video-react-player-block",
1328
1346
  ref: function ref(c) {
1329
- _this5.playerBlock = c;
1347
+ _this6.playerBlock = c;
1330
1348
  },
1331
1349
  style: this.getStyle(),
1332
1350
  HDBorder: player.HDBorderActive,
@@ -1334,7 +1352,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1334
1352
  }, isBuffering && /*#__PURE__*/_react["default"].createElement("div", {
1335
1353
  className: "loader-container",
1336
1354
  onClick: function onClick() {
1337
- return _this5.togglePlay();
1355
+ return _this6.togglePlay();
1338
1356
  }
1339
1357
  }, /*#__PURE__*/_react["default"].createElement(_components.Loader, {
1340
1358
  theme: theme,
@@ -1342,7 +1360,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1342
1360
  })) || null, fileType === 'audio' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("canvas", {
1343
1361
  id: "canvas",
1344
1362
  ref: function ref(c) {
1345
- _this5.canvas = c;
1363
+ _this6.canvas = c;
1346
1364
  },
1347
1365
  style: {
1348
1366
  top: 0,
@@ -1353,7 +1371,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1353
1371
  id: videoId,
1354
1372
  crossOrigin: "anonymous",
1355
1373
  ref: function ref(c) {
1356
- _this5.video = c;
1374
+ _this6.video = c;
1357
1375
  },
1358
1376
  muted: muted,
1359
1377
  preload: preload,
@@ -1389,7 +1407,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1389
1407
  id: videoId,
1390
1408
  crossOrigin: crossOrigin,
1391
1409
  ref: function ref(c) {
1392
- _this5.video = c;
1410
+ _this6.video = c;
1393
1411
  },
1394
1412
  muted: muted,
1395
1413
  preload: preload,
@@ -1421,7 +1439,8 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1421
1439
  onVolumeChange: this.handleVolumeChange
1422
1440
  }, /*#__PURE__*/_react["default"].createElement("track", {
1423
1441
  kind: "captions"
1424
- }), 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),
1425
1444
  ref: this.props.playerSvgRef,
1426
1445
  onMouseDown: this.props.handleMouseDown,
1427
1446
  onMouseMove: this.props.handleMouseMove,
@@ -1436,8 +1455,8 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1436
1455
  zIndex: 999
1437
1456
  }
1438
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) {
1439
- var _this5$props$playerSv;
1440
- 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;
1441
1460
  if (!svg) return null;
1442
1461
  var svgData = svg.getBoundingClientRect();
1443
1462
  var width = svgData.width;
@@ -1457,10 +1476,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1457
1476
  strokeWidth: "4",
1458
1477
  fill: "none",
1459
1478
  onMouseDown: function onMouseDown(e) {
1460
- return _this5.props.onShapeMouseDown(e, idx, ann);
1479
+ return _this6.props.onShapeMouseDown(e, idx, ann);
1461
1480
  },
1462
1481
  style: {
1463
- cursor: _this5.props.isSvgLayer ? 'move' : 'default'
1482
+ cursor: _this6.props.isSvgLayer ? 'move' : 'default'
1464
1483
  }
1465
1484
  });
1466
1485
  } else if (ann.type === 'line' || ann.type === 'arrow') {
@@ -1478,25 +1497,25 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1478
1497
  strokeWidth: "4",
1479
1498
  markerEnd: ann.type === 'arrow' ? "url(#open-arrowhead-".concat(ann.color.replace('#', ''), "-").concat(idx, ")") : undefined,
1480
1499
  onMouseDown: function onMouseDown(e) {
1481
- return _this5.props.onShapeMouseDown(e, idx, ann);
1500
+ return _this6.props.onShapeMouseDown(e, idx, ann);
1482
1501
  },
1483
1502
  style: {
1484
1503
  color: ann.color,
1485
- cursor: _this5.props.isSvgLayer ? 'move' : 'default'
1504
+ cursor: _this6.props.isSvgLayer ? 'move' : 'default'
1486
1505
  }
1487
1506
  });
1488
1507
  } else if (ann.type === 'pencil') {
1489
1508
  return /*#__PURE__*/_react["default"].createElement("path", {
1490
1509
  key: idx,
1491
- d: _this5.buildSmoothPath(ann.points, width, height),
1510
+ d: _this6.buildSmoothPath(ann.points, width, height),
1492
1511
  stroke: ann.color,
1493
1512
  strokeWidth: "4",
1494
1513
  fill: "none",
1495
1514
  onMouseDown: function onMouseDown(e) {
1496
- return _this5.props.onShapeMouseDown(e, idx, ann);
1515
+ return _this6.props.onShapeMouseDown(e, idx, ann);
1497
1516
  },
1498
1517
  style: {
1499
- cursor: _this5.props.isSvgLayer ? 'move' : 'default'
1518
+ cursor: _this6.props.isSvgLayer ? 'move' : 'default'
1500
1519
  }
1501
1520
  });
1502
1521
  }
@@ -1520,7 +1539,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1520
1539
  }));
1521
1540
  }
1522
1541
  return null;
1523
- })))), children, /*#__PURE__*/_react["default"].createElement("p", {
1542
+ }))) : null), children, /*#__PURE__*/_react["default"].createElement("p", {
1524
1543
  className: "user-name-wrapper",
1525
1544
  id: "watermark-text",
1526
1545
  style: _objectSpread({}, watermark)
@@ -1528,11 +1547,11 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1528
1547
  id: "outer",
1529
1548
  currentSubtitleObj: currentSubtitleObj,
1530
1549
  onClick: function onClick() {
1531
- return _this5.handleSubtitleContainerClick();
1550
+ return _this6.handleSubtitleContainerClick();
1532
1551
  }
1533
1552
  }, /*#__PURE__*/_react["default"].createElement("span", {
1534
1553
  onClick: function onClick(e) {
1535
- return _this5.handleSubtitleClick(e);
1554
+ return _this6.handleSubtitleClick(e);
1536
1555
  },
1537
1556
  className: "subtitleContainer longSubtitleStyles",
1538
1557
  style: _objectSpread({}, currentSubtitleObj.style)
@@ -1554,6 +1573,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
1554
1573
  }) || null)));
1555
1574
  }
1556
1575
  }]);
1576
+ return Video;
1557
1577
  }(_react.Component);
1558
1578
  Video.propTypes = propTypes;
1559
1579
  Video.defaultProps = defaultProps;