@desynova-digital/player 4.0.103 → 4.0.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Manager.js +9 -8
- package/actions/player.js +1 -1
- package/components/AudioMeter.js +30 -29
- package/components/BigPlayButton.js +17 -16
- package/components/ImageViewer.js +17 -16
- package/components/MarkerBar.js +17 -16
- package/components/Menu.js +2 -2
- package/components/Player.js +52 -51
- package/components/PlayerHeader.js +26 -25
- package/components/Playlist.js +16 -15
- package/components/PointersBar.js +20 -19
- package/components/PosterImage.js +1 -1
- package/components/SDOutline.js +7 -7
- package/components/Shortcut.js +70 -69
- package/components/Slider.js +33 -33
- package/components/TagsBar.js +16 -15
- package/components/Video.js +391 -284
- package/components/control-bar/AudioTracksMenuButton.js +15 -14
- package/components/control-bar/CameraButton.js +16 -15
- package/components/control-bar/CaptionControlMenuButton.js +20 -19
- package/components/control-bar/CommentsButton.js +17 -16
- package/components/control-bar/ControlBar.js +19 -18
- package/components/control-bar/EditorControlMenuButton.js +17 -16
- package/components/control-bar/ForwardControl.js +1 -1
- package/components/control-bar/ForwardReplayControl.js +16 -15
- package/components/control-bar/FullscreenToggle.js +16 -15
- package/components/control-bar/PlayToggle.js +16 -15
- package/components/control-bar/ReplayControl.js +1 -1
- package/components/control-bar/SettingsMenuButton.js +4 -4
- package/components/control-bar/SubtitleLanguagesMenuButton.js +15 -14
- package/components/control-bar/SubtitleMovementMenu.js +17 -16
- package/components/control-bar/VolumeMenuButton.js +17 -16
- package/components/control-bar/ZoomMenuButton.js +17 -16
- package/components/marking-controls/MarkInControl.js +16 -15
- package/components/marking-controls/MarkOutControl.js +16 -15
- package/components/marking-controls/MarkingAddButton.js +16 -15
- package/components/marking-controls/MarkingControl.js +2 -2
- package/components/marking-controls/MarkingDeleteButton.js +16 -15
- package/components/marking-controls/MarkingDuration.js +2 -2
- package/components/marking-controls/MarkingPreview.js +16 -15
- package/components/marking-controls/TimecodeFormatSelector.js +7 -7
- package/components/progress-bar/AudioWaveform.js +16 -15
- package/components/progress-bar/LoadProgressBar.js +1 -1
- package/components/progress-bar/MouseTimeDisplay.js +1 -1
- package/components/progress-bar/PlayProgressBar.js +2 -2
- package/components/progress-bar/ProgressControl.js +22 -21
- package/components/progress-bar/RenderCommentMarkers.js +23 -23
- package/components/progress-bar/SeekBar.js +35 -34
- package/components/progress-bar/Timeline.js +15 -14
- package/components/settings-menu-control/CameraControl.js +3 -3
- package/components/settings-menu-control/ChildMenuComponent.js +29 -28
- package/components/settings-menu-control/ParentMenuComponent.js +18 -17
- package/components/settings-menu-control/PlaybackRateControl.js +16 -15
- package/components/settings-menu-control/SafeAreaControl.js +16 -15
- package/components/settings-menu-control/SettingsMenu.js +12 -12
- package/components/time-controls/CurrentTimeDisplay.js +7 -7
- package/components/time-controls/DurationDisplay.js +2 -2
- package/components/time-controls/TimeDivider.js +2 -2
- package/components/volume-control/VolumeBar.js +25 -24
- package/components/volume-control/VolumeControl.js +1 -1
- package/components/volume-control/VolumeLevel.js +2 -2
- package/components/zoom-control/ZoomBar.js +24 -23
- package/components/zoom-control/ZoomLevel.js +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
- package/reducers/operation.js +2 -2
- package/reducers/player.js +2 -2
- package/utils/browser.js +14 -14
- package/utils/dom.js +18 -18
- package/utils/fullscreen.js +6 -5
- package/utils/index.js +54 -54
package/components/Video.js
CHANGED
|
@@ -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(
|
|
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 &&
|
|
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() {
|
|
26
|
-
function _slicedToArray(
|
|
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(
|
|
29
|
-
function _arrayLikeToArray(
|
|
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(
|
|
32
|
-
function _classCallCheck(
|
|
33
|
-
function _defineProperties(
|
|
34
|
-
function _createClass(
|
|
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(
|
|
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(
|
|
40
|
-
function
|
|
41
|
-
function
|
|
42
|
-
function
|
|
43
|
-
function
|
|
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(
|
|
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),
|
|
@@ -115,11 +115,12 @@ var VideoBlock = _styledComponents["default"].div(_templateObject2 || (_template
|
|
|
115
115
|
return props.isFullScreen && props.isRightMenuVisible ? '-30px' : '-50px';
|
|
116
116
|
});
|
|
117
117
|
var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
118
|
+
_inherits(Video, _Component);
|
|
118
119
|
function Video(props) {
|
|
119
120
|
var _this;
|
|
120
121
|
_classCallCheck(this, Video);
|
|
121
122
|
_this = _callSuper(this, Video, [props]);
|
|
122
|
-
_defineProperty(_this, "updateAnnotateVisibility", function () {
|
|
123
|
+
_defineProperty(_assertThisInitialized(_this), "updateAnnotateVisibility", function () {
|
|
123
124
|
if (!_this.video) return;
|
|
124
125
|
var _this$props = _this.props,
|
|
125
126
|
initialTime = _this$props.initialTime,
|
|
@@ -137,10 +138,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
140
|
});
|
|
140
|
-
_defineProperty(_this, "onVideoTimeUpdate", function () {
|
|
141
|
+
_defineProperty(_assertThisInitialized(_this), "onVideoTimeUpdate", function () {
|
|
141
142
|
_this.updateAnnotateVisibility();
|
|
142
143
|
});
|
|
143
|
-
_defineProperty(_this, "buildSmoothPath", function (points, width, height) {
|
|
144
|
+
_defineProperty(_assertThisInitialized(_this), "buildSmoothPath", function (points, width, height) {
|
|
144
145
|
if (!points || points.length < 2) return '';
|
|
145
146
|
var startX = points[0].x * width;
|
|
146
147
|
var startY = points[0].y * height;
|
|
@@ -159,7 +160,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
159
160
|
path += " L ".concat(lastX, " ").concat(lastY);
|
|
160
161
|
return path;
|
|
161
162
|
});
|
|
162
|
-
_defineProperty(_this, "getTimeData", function (time) {
|
|
163
|
+
_defineProperty(_assertThisInitialized(_this), "getTimeData", function (time) {
|
|
163
164
|
var _this$props2 = _this.props,
|
|
164
165
|
inTime = _this$props2.inTime,
|
|
165
166
|
outTime = _this$props2.outTime,
|
|
@@ -197,6 +198,12 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
197
198
|
formattedTime: currentFormattedTime
|
|
198
199
|
};
|
|
199
200
|
});
|
|
201
|
+
_defineProperty(_assertThisInitialized(_this), "isFullscreenWithRightMenu", function () {
|
|
202
|
+
var _this$props3 = _this.props,
|
|
203
|
+
player = _this$props3.player,
|
|
204
|
+
isRightMenuVisible = _this$props3.isRightMenuVisible;
|
|
205
|
+
return !!(player !== null && player !== void 0 && player.isFullscreen && isRightMenuVisible);
|
|
206
|
+
});
|
|
200
207
|
_this.state = {
|
|
201
208
|
audioTracks: [],
|
|
202
209
|
isM3U8: false,
|
|
@@ -215,52 +222,60 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
215
222
|
isBuffering: false,
|
|
216
223
|
currentSubtitleObj: {},
|
|
217
224
|
shouldShowAnnotate: false,
|
|
218
|
-
annotationsVersion: 0
|
|
225
|
+
annotationsVersion: 0,
|
|
226
|
+
svgSize: {
|
|
227
|
+
width: 0,
|
|
228
|
+
height: 0
|
|
229
|
+
},
|
|
230
|
+
calculatedHeight: null
|
|
219
231
|
};
|
|
220
232
|
_this.video = null; // the html5 video
|
|
221
233
|
_this.manager = new _Manager["default"](props.store);
|
|
222
|
-
_this.getStyle = _this.getStyle.bind(_this);
|
|
223
|
-
_this.getChildren = _this.getChildren.bind(_this);
|
|
224
|
-
_this.play = _this.play.bind(_this);
|
|
225
|
-
_this.pause = _this.pause.bind(_this);
|
|
226
|
-
_this.seek = _this.seek.bind(_this);
|
|
227
|
-
_this.forward = _this.forward.bind(_this);
|
|
228
|
-
_this.replay = _this.replay.bind(_this);
|
|
229
|
-
_this.toggleFullscreen = _this.toggleFullscreen.bind(_this);
|
|
230
|
-
_this.getProperties = _this.getProperties.bind(_this);
|
|
231
|
-
_this.renderChildren = _this.renderChildren.bind(_this);
|
|
232
|
-
_this.handleLoadStart = _this.handleLoadStart.bind(_this);
|
|
233
|
-
_this.handleCanPlay = _this.handleCanPlay.bind(_this);
|
|
234
|
-
_this.handleCanPlayThrough = _this.handleCanPlayThrough.bind(_this);
|
|
235
|
-
_this.handlePlay = _this.handlePlay.bind(_this);
|
|
236
|
-
_this.handlePlaying = _this.handlePlaying.bind(_this);
|
|
237
|
-
_this.handlePause = _this.handlePause.bind(_this);
|
|
238
|
-
_this.handleEnded = _this.handleEnded.bind(_this);
|
|
239
|
-
_this.handleWaiting = _this.handleWaiting.bind(_this);
|
|
240
|
-
_this.handleSeeking = _this.handleSeeking.bind(_this);
|
|
241
|
-
_this.handleSeeked = _this.handleSeeked.bind(_this);
|
|
242
|
-
_this.handleFullscreenChange = _this.handleFullscreenChange.bind(_this);
|
|
243
|
-
_this.handleError = _this.handleError.bind(_this);
|
|
244
|
-
_this.handleSuspend = _this.handleSuspend.bind(_this);
|
|
245
|
-
_this.handleAbort = _this.handleAbort.bind(_this);
|
|
246
|
-
_this.handleEmptied = _this.handleEmptied.bind(_this);
|
|
247
|
-
_this.handleStalled = _this.handleStalled.bind(_this);
|
|
248
|
-
_this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_this);
|
|
249
|
-
_this.handleLoadedData = _this.handleLoadedData.bind(_this);
|
|
250
|
-
_this.handleTimeUpdate = _this.handleTimeUpdate.bind(_this);
|
|
251
|
-
_this.handleRateChange = _this.handleRateChange.bind(_this);
|
|
252
|
-
_this.handleVolumeChange = _this.handleVolumeChange.bind(_this);
|
|
253
|
-
_this.handleDurationChange = _this.handleDurationChange.bind(_this);
|
|
254
|
-
_this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_this), 250);
|
|
255
|
-
_this.handleKeypress = _this.handleKeypress.bind(_this);
|
|
256
|
-
_this.audioVisualizer = _this.audioVisualizer.bind(_this);
|
|
257
|
-
_this.checkWatermark = _this.checkWatermark.bind(_this);
|
|
234
|
+
_this.getStyle = _this.getStyle.bind(_assertThisInitialized(_this));
|
|
235
|
+
_this.getChildren = _this.getChildren.bind(_assertThisInitialized(_this));
|
|
236
|
+
_this.play = _this.play.bind(_assertThisInitialized(_this));
|
|
237
|
+
_this.pause = _this.pause.bind(_assertThisInitialized(_this));
|
|
238
|
+
_this.seek = _this.seek.bind(_assertThisInitialized(_this));
|
|
239
|
+
_this.forward = _this.forward.bind(_assertThisInitialized(_this));
|
|
240
|
+
_this.replay = _this.replay.bind(_assertThisInitialized(_this));
|
|
241
|
+
_this.toggleFullscreen = _this.toggleFullscreen.bind(_assertThisInitialized(_this));
|
|
242
|
+
_this.getProperties = _this.getProperties.bind(_assertThisInitialized(_this));
|
|
243
|
+
_this.renderChildren = _this.renderChildren.bind(_assertThisInitialized(_this));
|
|
244
|
+
_this.handleLoadStart = _this.handleLoadStart.bind(_assertThisInitialized(_this));
|
|
245
|
+
_this.handleCanPlay = _this.handleCanPlay.bind(_assertThisInitialized(_this));
|
|
246
|
+
_this.handleCanPlayThrough = _this.handleCanPlayThrough.bind(_assertThisInitialized(_this));
|
|
247
|
+
_this.handlePlay = _this.handlePlay.bind(_assertThisInitialized(_this));
|
|
248
|
+
_this.handlePlaying = _this.handlePlaying.bind(_assertThisInitialized(_this));
|
|
249
|
+
_this.handlePause = _this.handlePause.bind(_assertThisInitialized(_this));
|
|
250
|
+
_this.handleEnded = _this.handleEnded.bind(_assertThisInitialized(_this));
|
|
251
|
+
_this.handleWaiting = _this.handleWaiting.bind(_assertThisInitialized(_this));
|
|
252
|
+
_this.handleSeeking = _this.handleSeeking.bind(_assertThisInitialized(_this));
|
|
253
|
+
_this.handleSeeked = _this.handleSeeked.bind(_assertThisInitialized(_this));
|
|
254
|
+
_this.handleFullscreenChange = _this.handleFullscreenChange.bind(_assertThisInitialized(_this));
|
|
255
|
+
_this.handleError = _this.handleError.bind(_assertThisInitialized(_this));
|
|
256
|
+
_this.handleSuspend = _this.handleSuspend.bind(_assertThisInitialized(_this));
|
|
257
|
+
_this.handleAbort = _this.handleAbort.bind(_assertThisInitialized(_this));
|
|
258
|
+
_this.handleEmptied = _this.handleEmptied.bind(_assertThisInitialized(_this));
|
|
259
|
+
_this.handleStalled = _this.handleStalled.bind(_assertThisInitialized(_this));
|
|
260
|
+
_this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_assertThisInitialized(_this));
|
|
261
|
+
_this.handleLoadedData = _this.handleLoadedData.bind(_assertThisInitialized(_this));
|
|
262
|
+
_this.handleTimeUpdate = _this.handleTimeUpdate.bind(_assertThisInitialized(_this));
|
|
263
|
+
_this.handleRateChange = _this.handleRateChange.bind(_assertThisInitialized(_this));
|
|
264
|
+
_this.handleVolumeChange = _this.handleVolumeChange.bind(_assertThisInitialized(_this));
|
|
265
|
+
_this.handleDurationChange = _this.handleDurationChange.bind(_assertThisInitialized(_this));
|
|
266
|
+
_this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_assertThisInitialized(_this)), 250);
|
|
267
|
+
_this.handleKeypress = _this.handleKeypress.bind(_assertThisInitialized(_this));
|
|
268
|
+
_this.audioVisualizer = _this.audioVisualizer.bind(_assertThisInitialized(_this));
|
|
269
|
+
_this.checkWatermark = _this.checkWatermark.bind(_assertThisInitialized(_this));
|
|
270
|
+
_this.updateSvgSize = _this.updateSvgSize.bind(_assertThisInitialized(_this));
|
|
271
|
+
_this.disconnectResizeObserver = _this.disconnectResizeObserver.bind(_assertThisInitialized(_this));
|
|
272
|
+
_this.calculateHeightBasedOnResolution = _this.calculateHeightBasedOnResolution.bind(_assertThisInitialized(_this));
|
|
258
273
|
return _this;
|
|
259
274
|
}
|
|
260
|
-
|
|
261
|
-
return _createClass(Video, [{
|
|
275
|
+
_createClass(Video, [{
|
|
262
276
|
key: "componentDidMount",
|
|
263
277
|
value: function componentDidMount() {
|
|
278
|
+
var _this2 = this;
|
|
264
279
|
var src = this.props.src;
|
|
265
280
|
var isM3U8 = src.split('.').pop() === 'm3u8' ? true : false;
|
|
266
281
|
this.setState({
|
|
@@ -280,33 +295,52 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
280
295
|
watermarkInterval: watermarkInterval
|
|
281
296
|
});
|
|
282
297
|
if (this.video) {
|
|
283
|
-
this.video.addEventListener(
|
|
298
|
+
this.video.addEventListener('timeupdate', this.onVideoTimeUpdate);
|
|
299
|
+
this.video.addEventListener('loadedmetadata', this.calculateHeightBasedOnResolution);
|
|
300
|
+
}
|
|
301
|
+
window.addEventListener('resize', this.calculateHeightBasedOnResolution);
|
|
302
|
+
this.updateSvgSize();
|
|
303
|
+
this.calculateHeightBasedOnResolution();
|
|
304
|
+
if (typeof ResizeObserver !== 'undefined' && this.playerBlock) {
|
|
305
|
+
this.resizeObserver = new ResizeObserver(function () {
|
|
306
|
+
_this2.updateSvgSize();
|
|
307
|
+
_this2.calculateHeightBasedOnResolution();
|
|
308
|
+
});
|
|
309
|
+
this.resizeObserver.observe(this.playerBlock);
|
|
284
310
|
}
|
|
285
311
|
}
|
|
286
312
|
}, {
|
|
287
313
|
key: "componentDidUpdate",
|
|
288
314
|
value: function componentDidUpdate(prevProps) {
|
|
289
|
-
var
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
315
|
+
var _this3 = this,
|
|
316
|
+
_prevProps$player;
|
|
317
|
+
var _this$props4 = this.props,
|
|
318
|
+
parentAnnotations = _this$props4.parentAnnotations,
|
|
319
|
+
inTime = _this$props4.inTime,
|
|
320
|
+
outTime = _this$props4.outTime,
|
|
321
|
+
isRightMenuVisible = _this$props4.isRightMenuVisible,
|
|
322
|
+
player = _this$props4.player;
|
|
294
323
|
var hasNewAnnotations = JSON.stringify(parentAnnotations) !== JSON.stringify(prevProps.parentAnnotations);
|
|
295
324
|
if (hasNewAnnotations) {
|
|
296
325
|
Promise.resolve().then(function () {
|
|
297
|
-
|
|
326
|
+
_this3.setState(function (prevState) {
|
|
298
327
|
return {
|
|
299
328
|
annotationsVersion: (prevState.annotationsVersion || 0) + 1
|
|
300
329
|
};
|
|
301
330
|
});
|
|
302
331
|
});
|
|
303
332
|
}
|
|
333
|
+
if (isRightMenuVisible !== prevProps.isRightMenuVisible || (player === null || player === void 0 ? void 0 : player.isFullscreen) !== ((_prevProps$player = prevProps.player) === null || _prevProps$player === void 0 ? void 0 : _prevProps$player.isFullscreen)) {
|
|
334
|
+
this.updateSvgSize();
|
|
335
|
+
this.calculateHeightBasedOnResolution();
|
|
336
|
+
}
|
|
304
337
|
if (this.props.isSvgLayer && this.props.isSvgLayer !== prevProps.isSvgLayer) {
|
|
305
338
|
this.toggleViaAnnotatePlay();
|
|
306
339
|
}
|
|
307
340
|
if (inTime !== prevProps.inTime || outTime !== prevProps.outTime) {
|
|
308
341
|
this.updateAnnotateVisibility();
|
|
309
342
|
}
|
|
343
|
+
this.updateSvgSize();
|
|
310
344
|
}
|
|
311
345
|
}, {
|
|
312
346
|
key: "componentWillUnmount",
|
|
@@ -321,20 +355,23 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
321
355
|
}
|
|
322
356
|
clearInterval(watermarkInterval);
|
|
323
357
|
if (this.video) {
|
|
324
|
-
this.video.removeEventListener(
|
|
358
|
+
this.video.removeEventListener('timeupdate', this.onVideoTimeUpdate);
|
|
359
|
+
this.video.removeEventListener('loadedmetadata', this.calculateHeightBasedOnResolution);
|
|
325
360
|
}
|
|
361
|
+
window.removeEventListener('resize', this.calculateHeightBasedOnResolution);
|
|
362
|
+
this.disconnectResizeObserver();
|
|
326
363
|
}
|
|
327
364
|
}, {
|
|
328
365
|
key: "checkWatermark",
|
|
329
366
|
value:
|
|
330
|
-
/**
|
|
331
|
-
* This function is triggered on interval to shuffle the position of watermark on Player area
|
|
367
|
+
/**
|
|
368
|
+
* This function is triggered on interval to shuffle the position of watermark on Player area
|
|
332
369
|
*/
|
|
333
370
|
function checkWatermark() {
|
|
334
371
|
var watermark = this.state.watermark;
|
|
335
|
-
var _this$
|
|
336
|
-
onPlayerClose = _this$
|
|
337
|
-
userEmail = _this$
|
|
372
|
+
var _this$props5 = this.props,
|
|
373
|
+
onPlayerClose = _this$props5.onPlayerClose,
|
|
374
|
+
userEmail = _this$props5.userEmail;
|
|
338
375
|
var watermark_text = document.querySelector('#watermark-text');
|
|
339
376
|
var video_player = null;
|
|
340
377
|
var watermark_dimension = null;
|
|
@@ -366,10 +403,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
366
403
|
}, {
|
|
367
404
|
key: "setupHLS",
|
|
368
405
|
value: function setupHLS(src) {
|
|
369
|
-
var
|
|
370
|
-
var _this$
|
|
371
|
-
actions = _this$
|
|
372
|
-
activeTrackIndex = _this$
|
|
406
|
+
var _this4 = this;
|
|
407
|
+
var _this$props6 = this.props,
|
|
408
|
+
actions = _this$props6.actions,
|
|
409
|
+
activeTrackIndex = _this$props6.activeTrackIndex;
|
|
373
410
|
var self = this;
|
|
374
411
|
// bind them together
|
|
375
412
|
this.hls.attachMedia(this.video);
|
|
@@ -390,18 +427,18 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
390
427
|
switch (data.type) {
|
|
391
428
|
case _hls["default"].ErrorTypes.NETWORK_ERROR:
|
|
392
429
|
// try to recover network error
|
|
393
|
-
|
|
430
|
+
_this4.hls.startLoad();
|
|
394
431
|
break;
|
|
395
432
|
case _hls["default"].ErrorTypes.MEDIA_ERROR:
|
|
396
|
-
|
|
433
|
+
_this4.hls.recoverMediaError();
|
|
397
434
|
break;
|
|
398
435
|
default:
|
|
399
436
|
// cannot recover
|
|
400
|
-
|
|
437
|
+
_this4.hls.destroy();
|
|
401
438
|
break;
|
|
402
439
|
}
|
|
403
440
|
} else if (data.details === 'internalException' && data.type === 'otherError' || data.details === 'bufferStalledError' && data.type === 'mediaError') {
|
|
404
|
-
|
|
441
|
+
_this4.hls.startLoad();
|
|
405
442
|
}
|
|
406
443
|
});
|
|
407
444
|
}
|
|
@@ -491,19 +528,19 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
491
528
|
}, {
|
|
492
529
|
key: "getStyle",
|
|
493
530
|
value: function getStyle() {
|
|
494
|
-
var _this$
|
|
495
|
-
fluid = _this$
|
|
496
|
-
noRightComponent = _this$
|
|
531
|
+
var _this$props7 = this.props,
|
|
532
|
+
fluid = _this$props7.fluid,
|
|
533
|
+
noRightComponent = _this$props7.noRightComponent;
|
|
497
534
|
var _this$manager$getStat2 = this.manager.getState(),
|
|
498
535
|
player = _this$manager$getStat2.player;
|
|
499
536
|
var style = {};
|
|
500
|
-
var _this$
|
|
501
|
-
aspectRatio = _this$
|
|
502
|
-
width = _this$
|
|
503
|
-
height = _this$
|
|
504
|
-
/*
|
|
505
|
-
* The aspect ratio is either used directly
|
|
506
|
-
* or to calculate width and height.
|
|
537
|
+
var _this$props8 = this.props,
|
|
538
|
+
aspectRatio = _this$props8.aspectRatio,
|
|
539
|
+
width = _this$props8.width,
|
|
540
|
+
height = _this$props8.height;
|
|
541
|
+
/*
|
|
542
|
+
* The aspect ratio is either used directly
|
|
543
|
+
* or to calculate width and height.
|
|
507
544
|
*/
|
|
508
545
|
if (player.videoWidth) {
|
|
509
546
|
// Otherwise try to get the aspect ratio from the video metadata
|
|
@@ -541,12 +578,12 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
541
578
|
}, {
|
|
542
579
|
key: "getProperties",
|
|
543
580
|
value: function getProperties() {
|
|
544
|
-
var
|
|
581
|
+
var _this5 = this;
|
|
545
582
|
if (!this.video) {
|
|
546
583
|
return null;
|
|
547
584
|
}
|
|
548
585
|
return _utils.mediaProperties.reduce(function (properties, key) {
|
|
549
|
-
properties[key] =
|
|
586
|
+
properties[key] = _this5.video[key];
|
|
550
587
|
return properties;
|
|
551
588
|
}, {});
|
|
552
589
|
}
|
|
@@ -558,9 +595,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
558
595
|
return this.video.playbackRate;
|
|
559
596
|
}
|
|
560
597
|
|
|
561
|
-
/*
|
|
562
|
-
* set playback rate
|
|
563
|
-
* speed of video
|
|
598
|
+
/*
|
|
599
|
+
* set playback rate
|
|
600
|
+
* speed of video
|
|
564
601
|
*/,
|
|
565
602
|
set: function set(rate) {
|
|
566
603
|
this.video.playbackRate = rate;
|
|
@@ -604,12 +641,12 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
604
641
|
}, {
|
|
605
642
|
key: "UNSAFE_componentWillReceiveProps",
|
|
606
643
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
607
|
-
var _this$
|
|
608
|
-
src = _this$
|
|
609
|
-
activeAudio = _this$
|
|
610
|
-
currentSubtitleObj = _this$
|
|
611
|
-
markers = _this$
|
|
612
|
-
playerType = _this$
|
|
644
|
+
var _this$props9 = this.props,
|
|
645
|
+
src = _this$props9.src,
|
|
646
|
+
activeAudio = _this$props9.player.activeAudio,
|
|
647
|
+
currentSubtitleObj = _this$props9.currentSubtitleObj,
|
|
648
|
+
markers = _this$props9.markers,
|
|
649
|
+
playerType = _this$props9.playerType;
|
|
613
650
|
if (markers && markers !== newProps.markers && newProps.markers) {
|
|
614
651
|
this.displaySubtitle(newProps.markers);
|
|
615
652
|
}
|
|
@@ -770,23 +807,23 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
770
807
|
}, {
|
|
771
808
|
key: "toggleFullscreen",
|
|
772
809
|
value: function toggleFullscreen() {
|
|
773
|
-
var _this$
|
|
774
|
-
player = _this$
|
|
775
|
-
actions = _this$
|
|
810
|
+
var _this$props10 = this.props,
|
|
811
|
+
player = _this$props10.player,
|
|
812
|
+
actions = _this$props10.actions;
|
|
776
813
|
actions.toggleFullscreen(player);
|
|
777
814
|
}
|
|
778
815
|
|
|
779
|
-
/*
|
|
780
|
-
* Fired when the user agent
|
|
781
|
-
* begins looking for media data
|
|
816
|
+
/*
|
|
817
|
+
* Fired when the user agent
|
|
818
|
+
* begins looking for media data
|
|
782
819
|
*/
|
|
783
820
|
}, {
|
|
784
821
|
key: "handleLoadStart",
|
|
785
822
|
value: function handleLoadStart() {
|
|
786
|
-
var _this$
|
|
787
|
-
actions = _this$
|
|
788
|
-
onLoadStart = _this$
|
|
789
|
-
fileType = _this$
|
|
823
|
+
var _this$props11 = this.props,
|
|
824
|
+
actions = _this$props11.actions,
|
|
825
|
+
onLoadStart = _this$props11.onLoadStart,
|
|
826
|
+
fileType = _this$props11.fileType;
|
|
790
827
|
if (fileType === 'audio') {
|
|
791
828
|
this.audioVisualizer();
|
|
792
829
|
}
|
|
@@ -796,48 +833,48 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
796
833
|
}
|
|
797
834
|
}
|
|
798
835
|
|
|
799
|
-
/*
|
|
800
|
-
* A handler for events that
|
|
801
|
-
* signal that waiting has ended
|
|
836
|
+
/*
|
|
837
|
+
* A handler for events that
|
|
838
|
+
* signal that waiting has ended
|
|
802
839
|
*/
|
|
803
840
|
}, {
|
|
804
841
|
key: "handleCanPlay",
|
|
805
842
|
value: function handleCanPlay() {
|
|
806
|
-
var _this$
|
|
807
|
-
actions = _this$
|
|
808
|
-
onCanPlay = _this$
|
|
843
|
+
var _this$props12 = this.props,
|
|
844
|
+
actions = _this$props12.actions,
|
|
845
|
+
onCanPlay = _this$props12.onCanPlay;
|
|
809
846
|
actions.handleCanPlay(this.getProperties());
|
|
810
847
|
if (onCanPlay) {
|
|
811
848
|
onCanPlay.apply(void 0, arguments);
|
|
812
849
|
}
|
|
813
850
|
}
|
|
814
851
|
|
|
815
|
-
/*
|
|
816
|
-
* A handler for events that
|
|
817
|
-
* signal that waiting has ended
|
|
852
|
+
/*
|
|
853
|
+
* A handler for events that
|
|
854
|
+
* signal that waiting has ended
|
|
818
855
|
*/
|
|
819
856
|
}, {
|
|
820
857
|
key: "handleCanPlayThrough",
|
|
821
858
|
value: function handleCanPlayThrough() {
|
|
822
|
-
var _this$
|
|
823
|
-
actions = _this$
|
|
824
|
-
onCanPlayThrough = _this$
|
|
859
|
+
var _this$props13 = this.props,
|
|
860
|
+
actions = _this$props13.actions,
|
|
861
|
+
onCanPlayThrough = _this$props13.onCanPlayThrough;
|
|
825
862
|
actions.handleCanPlayThrough(this.getProperties());
|
|
826
863
|
if (onCanPlayThrough) {
|
|
827
864
|
onCanPlayThrough.apply(void 0, arguments);
|
|
828
865
|
}
|
|
829
866
|
}
|
|
830
867
|
|
|
831
|
-
/*
|
|
832
|
-
* A handler for events that
|
|
833
|
-
* signal that waiting has ended
|
|
868
|
+
/*
|
|
869
|
+
* A handler for events that
|
|
870
|
+
* signal that waiting has ended
|
|
834
871
|
*/
|
|
835
872
|
}, {
|
|
836
873
|
key: "handlePlaying",
|
|
837
874
|
value: function handlePlaying() {
|
|
838
|
-
var _this$
|
|
839
|
-
actions = _this$
|
|
840
|
-
onPlaying = _this$
|
|
875
|
+
var _this$props14 = this.props,
|
|
876
|
+
actions = _this$props14.actions,
|
|
877
|
+
onPlaying = _this$props14.onPlaying;
|
|
841
878
|
actions.handlePlaying(this.getProperties());
|
|
842
879
|
if (onPlaying) {
|
|
843
880
|
onPlaying.apply(void 0, arguments);
|
|
@@ -848,9 +885,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
848
885
|
}, {
|
|
849
886
|
key: "handlePlay",
|
|
850
887
|
value: function handlePlay() {
|
|
851
|
-
var _this$
|
|
852
|
-
actions = _this$
|
|
853
|
-
onPlay = _this$
|
|
888
|
+
var _this$props15 = this.props,
|
|
889
|
+
actions = _this$props15.actions,
|
|
890
|
+
onPlay = _this$props15.onPlay;
|
|
854
891
|
actions.handlePlay(this.getProperties());
|
|
855
892
|
if (onPlay) {
|
|
856
893
|
onPlay.apply(void 0, arguments);
|
|
@@ -861,41 +898,41 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
861
898
|
}, {
|
|
862
899
|
key: "handlePause",
|
|
863
900
|
value: function handlePause() {
|
|
864
|
-
var _this$
|
|
865
|
-
actions = _this$
|
|
866
|
-
onPause = _this$
|
|
901
|
+
var _this$props16 = this.props,
|
|
902
|
+
actions = _this$props16.actions,
|
|
903
|
+
onPause = _this$props16.onPause;
|
|
867
904
|
actions.handlePause(this.getProperties());
|
|
868
905
|
if (onPause) {
|
|
869
906
|
onPause.apply(void 0, arguments);
|
|
870
907
|
}
|
|
871
908
|
}
|
|
872
909
|
|
|
873
|
-
/*
|
|
874
|
-
* Fired when the duration of
|
|
875
|
-
* the media resource is first known or changed
|
|
910
|
+
/*
|
|
911
|
+
* Fired when the duration of
|
|
912
|
+
* the media resource is first known or changed
|
|
876
913
|
*/
|
|
877
914
|
}, {
|
|
878
915
|
key: "handleDurationChange",
|
|
879
916
|
value: function handleDurationChange() {
|
|
880
|
-
var _this$
|
|
881
|
-
actions = _this$
|
|
882
|
-
onDurationChange = _this$
|
|
917
|
+
var _this$props17 = this.props,
|
|
918
|
+
actions = _this$props17.actions,
|
|
919
|
+
onDurationChange = _this$props17.onDurationChange;
|
|
883
920
|
actions.handleDurationChange(this.getProperties());
|
|
884
921
|
if (onDurationChange) {
|
|
885
922
|
onDurationChange.apply(void 0, arguments);
|
|
886
923
|
}
|
|
887
924
|
}
|
|
888
925
|
|
|
889
|
-
/*
|
|
890
|
-
* Fired while the user agent
|
|
891
|
-
* is downloading media data
|
|
926
|
+
/*
|
|
927
|
+
* Fired while the user agent
|
|
928
|
+
* is downloading media data
|
|
892
929
|
*/
|
|
893
930
|
}, {
|
|
894
931
|
key: "handleProgress",
|
|
895
932
|
value: function handleProgress() {
|
|
896
|
-
var _this$
|
|
897
|
-
actions = _this$
|
|
898
|
-
onProgress = _this$
|
|
933
|
+
var _this$props18 = this.props,
|
|
934
|
+
actions = _this$props18.actions,
|
|
935
|
+
onProgress = _this$props18.onProgress;
|
|
899
936
|
if (this.video) {
|
|
900
937
|
actions.handleProgressChange(this.getProperties());
|
|
901
938
|
}
|
|
@@ -916,11 +953,11 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
916
953
|
}, {
|
|
917
954
|
key: "displaySubtitle",
|
|
918
955
|
value: function displaySubtitle(marker) {
|
|
919
|
-
var _this$
|
|
920
|
-
markers = _this$
|
|
921
|
-
resetSubtitleData = _this$
|
|
922
|
-
subtitleReadOnly = _this$
|
|
923
|
-
subtitleDataList = _this$
|
|
956
|
+
var _this$props19 = this.props,
|
|
957
|
+
markers = _this$props19.markers,
|
|
958
|
+
resetSubtitleData = _this$props19.resetSubtitleData,
|
|
959
|
+
subtitleReadOnly = _this$props19.subtitleReadOnly,
|
|
960
|
+
subtitleDataList = _this$props19.subtitleDataList;
|
|
924
961
|
var currentSubtitleObj = this.state.currentSubtitleObj;
|
|
925
962
|
if (resetSubtitleData) {
|
|
926
963
|
resetSubtitleData();
|
|
@@ -955,18 +992,18 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
955
992
|
}
|
|
956
993
|
}
|
|
957
994
|
|
|
958
|
-
/*
|
|
959
|
-
* Fired when the end of the media resource
|
|
960
|
-
* is reached (currentTime == duration)
|
|
995
|
+
/*
|
|
996
|
+
* Fired when the end of the media resource
|
|
997
|
+
* is reached (currentTime == duration)
|
|
961
998
|
*/
|
|
962
999
|
}, {
|
|
963
1000
|
key: "handleEnded",
|
|
964
1001
|
value: function handleEnded() {
|
|
965
|
-
var _this$
|
|
966
|
-
loop = _this$
|
|
967
|
-
player = _this$
|
|
968
|
-
actions = _this$
|
|
969
|
-
onEnded = _this$
|
|
1002
|
+
var _this$props20 = this.props,
|
|
1003
|
+
loop = _this$props20.loop,
|
|
1004
|
+
player = _this$props20.player,
|
|
1005
|
+
actions = _this$props20.actions,
|
|
1006
|
+
onEnded = _this$props20.onEnded;
|
|
970
1007
|
if (loop) {
|
|
971
1008
|
this.seek(0);
|
|
972
1009
|
this.play();
|
|
@@ -983,41 +1020,41 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
983
1020
|
}, {
|
|
984
1021
|
key: "handleWaiting",
|
|
985
1022
|
value: function handleWaiting() {
|
|
986
|
-
var _this$
|
|
987
|
-
actions = _this$
|
|
988
|
-
onWaiting = _this$
|
|
1023
|
+
var _this$props21 = this.props,
|
|
1024
|
+
actions = _this$props21.actions,
|
|
1025
|
+
onWaiting = _this$props21.onWaiting;
|
|
989
1026
|
actions.handleWaiting(this.getProperties());
|
|
990
1027
|
if (onWaiting) {
|
|
991
1028
|
onWaiting.apply(void 0, arguments);
|
|
992
1029
|
}
|
|
993
1030
|
}
|
|
994
1031
|
|
|
995
|
-
/*
|
|
996
|
-
* Fired whenever the player
|
|
997
|
-
* is jumping to a new time
|
|
1032
|
+
/*
|
|
1033
|
+
* Fired whenever the player
|
|
1034
|
+
* is jumping to a new time
|
|
998
1035
|
*/
|
|
999
1036
|
}, {
|
|
1000
1037
|
key: "handleSeeking",
|
|
1001
1038
|
value: function handleSeeking() {
|
|
1002
|
-
var _this$
|
|
1003
|
-
actions = _this$
|
|
1004
|
-
onSeeking = _this$
|
|
1039
|
+
var _this$props22 = this.props,
|
|
1040
|
+
actions = _this$props22.actions,
|
|
1041
|
+
onSeeking = _this$props22.onSeeking;
|
|
1005
1042
|
actions.handleSeeking(this.getProperties());
|
|
1006
1043
|
if (onSeeking) {
|
|
1007
1044
|
onSeeking.apply(void 0, arguments);
|
|
1008
1045
|
}
|
|
1009
1046
|
}
|
|
1010
1047
|
|
|
1011
|
-
/*
|
|
1012
|
-
* Fired when the player has
|
|
1013
|
-
* finished jumping to a new time
|
|
1048
|
+
/*
|
|
1049
|
+
* Fired when the player has
|
|
1050
|
+
* finished jumping to a new time
|
|
1014
1051
|
*/
|
|
1015
1052
|
}, {
|
|
1016
1053
|
key: "handleSeeked",
|
|
1017
1054
|
value: function handleSeeked() {
|
|
1018
|
-
var _this$
|
|
1019
|
-
actions = _this$
|
|
1020
|
-
onSeeked = _this$
|
|
1055
|
+
var _this$props23 = this.props,
|
|
1056
|
+
actions = _this$props23.actions,
|
|
1057
|
+
onSeeked = _this$props23.onSeeked;
|
|
1021
1058
|
actions.handleSeeked(this.getProperties());
|
|
1022
1059
|
if (onSeeked) {
|
|
1023
1060
|
onSeeked.apply(void 0, arguments);
|
|
@@ -1029,16 +1066,16 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1029
1066
|
key: "handleFullscreenChange",
|
|
1030
1067
|
value: function handleFullscreenChange() {}
|
|
1031
1068
|
|
|
1032
|
-
/*
|
|
1033
|
-
* Fires when the browser is
|
|
1034
|
-
* intentionally not getting media data
|
|
1069
|
+
/*
|
|
1070
|
+
* Fires when the browser is
|
|
1071
|
+
* intentionally not getting media data
|
|
1035
1072
|
*/
|
|
1036
1073
|
}, {
|
|
1037
1074
|
key: "handleSuspend",
|
|
1038
1075
|
value: function handleSuspend() {
|
|
1039
|
-
var _this$
|
|
1040
|
-
actions = _this$
|
|
1041
|
-
onSuspend = _this$
|
|
1076
|
+
var _this$props24 = this.props,
|
|
1077
|
+
actions = _this$props24.actions,
|
|
1078
|
+
onSuspend = _this$props24.onSuspend;
|
|
1042
1079
|
actions.handleSuspend(this.getProperties());
|
|
1043
1080
|
if (onSuspend) {
|
|
1044
1081
|
onSuspend.apply(void 0, arguments);
|
|
@@ -1049,9 +1086,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1049
1086
|
}, {
|
|
1050
1087
|
key: "handleAbort",
|
|
1051
1088
|
value: function handleAbort() {
|
|
1052
|
-
var _this$
|
|
1053
|
-
actions = _this$
|
|
1054
|
-
onAbort = _this$
|
|
1089
|
+
var _this$props25 = this.props,
|
|
1090
|
+
actions = _this$props25.actions,
|
|
1091
|
+
onAbort = _this$props25.onAbort;
|
|
1055
1092
|
actions.handleAbort(this.getProperties());
|
|
1056
1093
|
if (onAbort) {
|
|
1057
1094
|
onAbort.apply(void 0, arguments);
|
|
@@ -1062,42 +1099,42 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1062
1099
|
}, {
|
|
1063
1100
|
key: "handleEmptied",
|
|
1064
1101
|
value: function handleEmptied() {
|
|
1065
|
-
var _this$
|
|
1066
|
-
actions = _this$
|
|
1067
|
-
onEmptied = _this$
|
|
1102
|
+
var _this$props26 = this.props,
|
|
1103
|
+
actions = _this$props26.actions,
|
|
1104
|
+
onEmptied = _this$props26.onEmptied;
|
|
1068
1105
|
actions.handleEmptied(this.getProperties());
|
|
1069
1106
|
if (onEmptied) {
|
|
1070
1107
|
onEmptied.apply(void 0, arguments);
|
|
1071
1108
|
}
|
|
1072
1109
|
}
|
|
1073
1110
|
|
|
1074
|
-
/*
|
|
1075
|
-
* Fires when the browser is trying to
|
|
1076
|
-
* get media data, but data is not available
|
|
1111
|
+
/*
|
|
1112
|
+
* Fires when the browser is trying to
|
|
1113
|
+
* get media data, but data is not available
|
|
1077
1114
|
*/
|
|
1078
1115
|
}, {
|
|
1079
1116
|
key: "handleStalled",
|
|
1080
1117
|
value: function handleStalled() {
|
|
1081
|
-
var _this$
|
|
1082
|
-
actions = _this$
|
|
1083
|
-
onStalled = _this$
|
|
1118
|
+
var _this$props27 = this.props,
|
|
1119
|
+
actions = _this$props27.actions,
|
|
1120
|
+
onStalled = _this$props27.onStalled;
|
|
1084
1121
|
actions.handleStalled(this.getProperties());
|
|
1085
1122
|
if (onStalled) {
|
|
1086
1123
|
onStalled.apply(void 0, arguments);
|
|
1087
1124
|
}
|
|
1088
1125
|
}
|
|
1089
1126
|
|
|
1090
|
-
/*
|
|
1091
|
-
* Fires when the browser has loaded
|
|
1092
|
-
* meta data for the audio/video
|
|
1127
|
+
/*
|
|
1128
|
+
* Fires when the browser has loaded
|
|
1129
|
+
* meta data for the audio/video
|
|
1093
1130
|
*/
|
|
1094
1131
|
}, {
|
|
1095
1132
|
key: "handleLoadedMetaData",
|
|
1096
1133
|
value: function handleLoadedMetaData() {
|
|
1097
|
-
var _this$
|
|
1098
|
-
actions = _this$
|
|
1099
|
-
onLoadedMetadata = _this$
|
|
1100
|
-
startTime = _this$
|
|
1134
|
+
var _this$props28 = this.props,
|
|
1135
|
+
actions = _this$props28.actions,
|
|
1136
|
+
onLoadedMetadata = _this$props28.onLoadedMetadata,
|
|
1137
|
+
startTime = _this$props28.startTime;
|
|
1101
1138
|
if (startTime && startTime > 0) {
|
|
1102
1139
|
this.video.currentTime = startTime;
|
|
1103
1140
|
}
|
|
@@ -1107,34 +1144,34 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1107
1144
|
}
|
|
1108
1145
|
}
|
|
1109
1146
|
|
|
1110
|
-
/*
|
|
1111
|
-
* Fires when the browser has loaded
|
|
1112
|
-
* the current frame of the audio/video
|
|
1147
|
+
/*
|
|
1148
|
+
* Fires when the browser has loaded
|
|
1149
|
+
* the current frame of the audio/video
|
|
1113
1150
|
*/
|
|
1114
1151
|
}, {
|
|
1115
1152
|
key: "handleLoadedData",
|
|
1116
1153
|
value: function handleLoadedData() {
|
|
1117
|
-
var _this$
|
|
1118
|
-
actions = _this$
|
|
1119
|
-
onLoadedData = _this$
|
|
1154
|
+
var _this$props29 = this.props,
|
|
1155
|
+
actions = _this$props29.actions,
|
|
1156
|
+
onLoadedData = _this$props29.onLoadedData;
|
|
1120
1157
|
actions.handleLoadedData(this.getProperties());
|
|
1121
1158
|
if (onLoadedData) {
|
|
1122
1159
|
onLoadedData.apply(void 0, arguments);
|
|
1123
1160
|
}
|
|
1124
1161
|
}
|
|
1125
1162
|
|
|
1126
|
-
/*
|
|
1127
|
-
* Fires when the current
|
|
1128
|
-
* playback position has changed
|
|
1163
|
+
/*
|
|
1164
|
+
* Fires when the current
|
|
1165
|
+
* playback position has changed
|
|
1129
1166
|
*/
|
|
1130
1167
|
}, {
|
|
1131
1168
|
key: "handleTimeUpdate",
|
|
1132
1169
|
value: function handleTimeUpdate() {
|
|
1133
|
-
var _this$
|
|
1134
|
-
previewActive = _this$
|
|
1135
|
-
actions = _this$
|
|
1136
|
-
onTimeUpdate = _this$
|
|
1137
|
-
rightMarker = _this$
|
|
1170
|
+
var _this$props30 = this.props,
|
|
1171
|
+
previewActive = _this$props30.player.previewActive,
|
|
1172
|
+
actions = _this$props30.actions,
|
|
1173
|
+
onTimeUpdate = _this$props30.onTimeUpdate,
|
|
1174
|
+
rightMarker = _this$props30.playerSelectedMarker.rightMarker;
|
|
1138
1175
|
|
|
1139
1176
|
//for annotation time updataton for svg
|
|
1140
1177
|
var _this$getTimeData3 = this.getTimeData(this.video.currentTime),
|
|
@@ -1156,15 +1193,15 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1156
1193
|
this.displaySubtitle();
|
|
1157
1194
|
}
|
|
1158
1195
|
|
|
1159
|
-
/**
|
|
1160
|
-
* Fires when the playing speed of the audio/video is changed
|
|
1196
|
+
/**
|
|
1197
|
+
* Fires when the playing speed of the audio/video is changed
|
|
1161
1198
|
*/
|
|
1162
1199
|
}, {
|
|
1163
1200
|
key: "handleRateChange",
|
|
1164
1201
|
value: function handleRateChange() {
|
|
1165
|
-
var _this$
|
|
1166
|
-
actions = _this$
|
|
1167
|
-
onRateChange = _this$
|
|
1202
|
+
var _this$props31 = this.props,
|
|
1203
|
+
actions = _this$props31.actions,
|
|
1204
|
+
onRateChange = _this$props31.onRateChange;
|
|
1168
1205
|
actions.handleRateChange(this.getProperties());
|
|
1169
1206
|
if (onRateChange) {
|
|
1170
1207
|
onRateChange.apply(void 0, arguments);
|
|
@@ -1175,25 +1212,25 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1175
1212
|
}, {
|
|
1176
1213
|
key: "handleVolumeChange",
|
|
1177
1214
|
value: function handleVolumeChange() {
|
|
1178
|
-
var _this$
|
|
1179
|
-
actions = _this$
|
|
1180
|
-
onVolumeChange = _this$
|
|
1215
|
+
var _this$props32 = this.props,
|
|
1216
|
+
actions = _this$props32.actions,
|
|
1217
|
+
onVolumeChange = _this$props32.onVolumeChange;
|
|
1181
1218
|
actions.handleVolumeChange(this.getProperties());
|
|
1182
1219
|
if (onVolumeChange) {
|
|
1183
1220
|
onVolumeChange.apply(void 0, arguments);
|
|
1184
1221
|
}
|
|
1185
1222
|
}
|
|
1186
1223
|
|
|
1187
|
-
/*
|
|
1188
|
-
* Fires when an error occurred
|
|
1189
|
-
* during the loading of an audio/video
|
|
1224
|
+
/*
|
|
1225
|
+
* Fires when an error occurred
|
|
1226
|
+
* during the loading of an audio/video
|
|
1190
1227
|
*/
|
|
1191
1228
|
}, {
|
|
1192
1229
|
key: "handleError",
|
|
1193
1230
|
value: function handleError() {
|
|
1194
|
-
var _this$
|
|
1195
|
-
actions = _this$
|
|
1196
|
-
onError = _this$
|
|
1231
|
+
var _this$props33 = this.props,
|
|
1232
|
+
actions = _this$props33.actions,
|
|
1233
|
+
onError = _this$props33.onError;
|
|
1197
1234
|
actions.handleError(this.getProperties());
|
|
1198
1235
|
if (onError) {
|
|
1199
1236
|
onError.apply(void 0, arguments);
|
|
@@ -1202,6 +1239,74 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1202
1239
|
}, {
|
|
1203
1240
|
key: "handleKeypress",
|
|
1204
1241
|
value: function handleKeypress() {}
|
|
1242
|
+
}, {
|
|
1243
|
+
key: "updateSvgSize",
|
|
1244
|
+
value: function updateSvgSize() {
|
|
1245
|
+
var el = this.video || this.playerBlock || this.video && this.video.parentNode;
|
|
1246
|
+
if (!el || typeof el.getBoundingClientRect !== 'function') return;
|
|
1247
|
+
var rect = el.getBoundingClientRect();
|
|
1248
|
+
var next = {
|
|
1249
|
+
width: Math.round(rect.width),
|
|
1250
|
+
height: Math.round(rect.height)
|
|
1251
|
+
};
|
|
1252
|
+
var svgSize = this.state.svgSize;
|
|
1253
|
+
if (svgSize.width !== next.width || svgSize.height !== next.height) {
|
|
1254
|
+
this.setState({
|
|
1255
|
+
svgSize: next
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
}, {
|
|
1260
|
+
key: "calculateHeightBasedOnResolution",
|
|
1261
|
+
value: function calculateHeightBasedOnResolution() {
|
|
1262
|
+
var _this$props34 = this.props,
|
|
1263
|
+
player = _this$props34.player,
|
|
1264
|
+
isRightMenuVisible = _this$props34.isRightMenuVisible,
|
|
1265
|
+
heightRatio = _this$props34.heightRatio;
|
|
1266
|
+
var ratio = typeof heightRatio === 'number' ? heightRatio : 1;
|
|
1267
|
+
if (!(player !== null && player !== void 0 && player.isFullscreen) || !isRightMenuVisible) {
|
|
1268
|
+
if (this.state.calculatedHeight !== null) {
|
|
1269
|
+
this.setState({
|
|
1270
|
+
calculatedHeight: null
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1275
|
+
try {
|
|
1276
|
+
var videoElement = this.video;
|
|
1277
|
+
if (!videoElement) return;
|
|
1278
|
+
var videoWidth = videoElement.videoWidth;
|
|
1279
|
+
var videoHeight = videoElement.videoHeight;
|
|
1280
|
+
if (!videoWidth || !videoHeight) return;
|
|
1281
|
+
var aspectRatio = videoWidth / videoHeight;
|
|
1282
|
+
var leftVideoSection = document.querySelector('.left-video-section');
|
|
1283
|
+
if (!leftVideoSection) return;
|
|
1284
|
+
var containerWidth = leftVideoSection.getBoundingClientRect().width;
|
|
1285
|
+
var newHeight = aspectRatio < 1.5 ? containerWidth * (3 / 4) : containerWidth * (9 / 16);
|
|
1286
|
+
var finalHeight = newHeight * ratio;
|
|
1287
|
+
if (this.state.calculatedHeight !== finalHeight) {
|
|
1288
|
+
this.setState({
|
|
1289
|
+
calculatedHeight: finalHeight
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
} catch (error) {
|
|
1293
|
+
// eslint-disable-next-line no-console
|
|
1294
|
+
console.error('Error calculating height:', error);
|
|
1295
|
+
if (this.state.calculatedHeight !== null) {
|
|
1296
|
+
this.setState({
|
|
1297
|
+
calculatedHeight: null
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}, {
|
|
1303
|
+
key: "disconnectResizeObserver",
|
|
1304
|
+
value: function disconnectResizeObserver() {
|
|
1305
|
+
if (this.resizeObserver) {
|
|
1306
|
+
this.resizeObserver.disconnect();
|
|
1307
|
+
this.resizeObserver = null;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1205
1310
|
}, {
|
|
1206
1311
|
key: "audioVisualizer",
|
|
1207
1312
|
value: function audioVisualizer() {
|
|
@@ -1237,10 +1342,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1237
1342
|
for (var i = 0; i < bufferLength; i++) {
|
|
1238
1343
|
barHeight = dataArray[i] * 2;
|
|
1239
1344
|
|
|
1240
|
-
/*
|
|
1241
|
-
* var r = barHeight + (25 * (i / bufferLength));
|
|
1242
|
-
* var g = 250 * (i / bufferLength);
|
|
1243
|
-
* var b = s50;
|
|
1345
|
+
/*
|
|
1346
|
+
* var r = barHeight + (25 * (i / bufferLength));
|
|
1347
|
+
* var g = 250 * (i / bufferLength);
|
|
1348
|
+
* var b = s50;
|
|
1244
1349
|
*/
|
|
1245
1350
|
|
|
1246
1351
|
ctx.fillStyle = '#0c141d'; // 'rgb(' + r + ',' + g + ',' + b + ')';
|
|
@@ -1253,7 +1358,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1253
1358
|
}, {
|
|
1254
1359
|
key: "renderChildren",
|
|
1255
1360
|
value: function renderChildren() {
|
|
1256
|
-
var
|
|
1361
|
+
var _this6 = this;
|
|
1257
1362
|
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
1258
1363
|
video: this.video
|
|
1259
1364
|
});
|
|
@@ -1275,7 +1380,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1275
1380
|
if (preOnError) {
|
|
1276
1381
|
preOnError.apply(void 0, arguments);
|
|
1277
1382
|
}
|
|
1278
|
-
|
|
1383
|
+
_this6.handleError.apply(_this6, arguments);
|
|
1279
1384
|
};
|
|
1280
1385
|
}
|
|
1281
1386
|
} else {
|
|
@@ -1287,9 +1392,9 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1287
1392
|
}, {
|
|
1288
1393
|
key: "handleSubtitleContainerClick",
|
|
1289
1394
|
value: function handleSubtitleContainerClick() {
|
|
1290
|
-
var _this$
|
|
1291
|
-
actions = _this$
|
|
1292
|
-
player = _this$
|
|
1395
|
+
var _this$props35 = this.props,
|
|
1396
|
+
actions = _this$props35.actions,
|
|
1397
|
+
player = _this$props35.player;
|
|
1293
1398
|
if (player.paused) {
|
|
1294
1399
|
actions.play();
|
|
1295
1400
|
} else {
|
|
@@ -1299,11 +1404,11 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1299
1404
|
}, {
|
|
1300
1405
|
key: "handleSubtitleClick",
|
|
1301
1406
|
value: function handleSubtitleClick(e) {
|
|
1302
|
-
var _this$
|
|
1303
|
-
actions = _this$
|
|
1304
|
-
player = _this$
|
|
1305
|
-
onScreenSubtitleClick = _this$
|
|
1306
|
-
controlType = _this$
|
|
1407
|
+
var _this$props36 = this.props,
|
|
1408
|
+
actions = _this$props36.actions,
|
|
1409
|
+
player = _this$props36.player,
|
|
1410
|
+
onScreenSubtitleClick = _this$props36.onScreenSubtitleClick,
|
|
1411
|
+
controlType = _this$props36.controlType;
|
|
1307
1412
|
var currentSubtitleObj = this.state.currentSubtitleObj;
|
|
1308
1413
|
if (controlType === 'advanced') {
|
|
1309
1414
|
if (onScreenSubtitleClick) {
|
|
@@ -1323,37 +1428,37 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1323
1428
|
}, {
|
|
1324
1429
|
key: "render",
|
|
1325
1430
|
value: function render() {
|
|
1326
|
-
var
|
|
1431
|
+
var _this7 = this,
|
|
1327
1432
|
_this$props$parentAnn,
|
|
1328
1433
|
_this$props$parentAnn2,
|
|
1329
1434
|
_this$props$parentAnn3,
|
|
1330
1435
|
_this$props$parentAnn4;
|
|
1331
|
-
var _this$
|
|
1332
|
-
loop = _this$
|
|
1333
|
-
poster = _this$
|
|
1334
|
-
preload = _this$
|
|
1335
|
-
autoPlay = _this$
|
|
1336
|
-
playsInline = _this$
|
|
1337
|
-
muted = _this$
|
|
1338
|
-
crossOrigin = _this$
|
|
1339
|
-
videoId = _this$
|
|
1340
|
-
fileType = _this$
|
|
1341
|
-
userEmail = _this$
|
|
1342
|
-
theme = _this$
|
|
1343
|
-
player = _this$
|
|
1344
|
-
playerType = _this$
|
|
1345
|
-
markers = _this$
|
|
1346
|
-
isRightMenuVisible = _this$
|
|
1436
|
+
var _this$props37 = this.props,
|
|
1437
|
+
loop = _this$props37.loop,
|
|
1438
|
+
poster = _this$props37.poster,
|
|
1439
|
+
preload = _this$props37.preload,
|
|
1440
|
+
autoPlay = _this$props37.autoPlay,
|
|
1441
|
+
playsInline = _this$props37.playsInline,
|
|
1442
|
+
muted = _this$props37.muted,
|
|
1443
|
+
crossOrigin = _this$props37.crossOrigin,
|
|
1444
|
+
videoId = _this$props37.videoId,
|
|
1445
|
+
fileType = _this$props37.fileType,
|
|
1446
|
+
userEmail = _this$props37.userEmail,
|
|
1447
|
+
theme = _this$props37.theme,
|
|
1448
|
+
player = _this$props37.player,
|
|
1449
|
+
playerType = _this$props37.playerType,
|
|
1450
|
+
markers = _this$props37.markers,
|
|
1451
|
+
isRightMenuVisible = _this$props37.isRightMenuVisible;
|
|
1347
1452
|
var _this$state2 = this.state,
|
|
1348
1453
|
isBuffering = _this$state2.isBuffering,
|
|
1349
1454
|
watermark = _this$state2.watermark,
|
|
1350
1455
|
currentSubtitleObj = _this$state2.currentSubtitleObj;
|
|
1351
1456
|
var children = this.getChildren(this.props);
|
|
1352
|
-
var isSubtitleActive = player.SubtitleStatus && playerType ===
|
|
1457
|
+
var isSubtitleActive = player.SubtitleStatus && playerType === 'default' || playerType === 'subtitle' && markers && markers.length || player.SubtitleStatus;
|
|
1353
1458
|
return /*#__PURE__*/_react["default"].createElement(VideoBlock, {
|
|
1354
1459
|
className: "video-react-player-block",
|
|
1355
1460
|
ref: function ref(c) {
|
|
1356
|
-
|
|
1461
|
+
_this7.playerBlock = c;
|
|
1357
1462
|
},
|
|
1358
1463
|
style: this.getStyle(),
|
|
1359
1464
|
HDBorder: player.HDBorderActive,
|
|
@@ -1363,7 +1468,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1363
1468
|
}, isBuffering && /*#__PURE__*/_react["default"].createElement("div", {
|
|
1364
1469
|
className: "loader-container",
|
|
1365
1470
|
onClick: function onClick() {
|
|
1366
|
-
return
|
|
1471
|
+
return _this7.togglePlay();
|
|
1367
1472
|
}
|
|
1368
1473
|
}, /*#__PURE__*/_react["default"].createElement(_components.Loader, {
|
|
1369
1474
|
theme: theme,
|
|
@@ -1371,7 +1476,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1371
1476
|
})) || null, fileType === 'audio' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("canvas", {
|
|
1372
1477
|
id: "canvas",
|
|
1373
1478
|
ref: function ref(c) {
|
|
1374
|
-
|
|
1479
|
+
_this7.canvas = c;
|
|
1375
1480
|
},
|
|
1376
1481
|
style: {
|
|
1377
1482
|
top: 0,
|
|
@@ -1382,7 +1487,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1382
1487
|
id: videoId,
|
|
1383
1488
|
crossOrigin: "anonymous",
|
|
1384
1489
|
ref: function ref(c) {
|
|
1385
|
-
|
|
1490
|
+
_this7.video = c;
|
|
1386
1491
|
},
|
|
1387
1492
|
muted: muted,
|
|
1388
1493
|
preload: preload,
|
|
@@ -1418,7 +1523,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1418
1523
|
id: videoId,
|
|
1419
1524
|
crossOrigin: crossOrigin,
|
|
1420
1525
|
ref: function ref(c) {
|
|
1421
|
-
|
|
1526
|
+
_this7.video = c;
|
|
1422
1527
|
},
|
|
1423
1528
|
muted: muted,
|
|
1424
1529
|
preload: preload,
|
|
@@ -1451,23 +1556,24 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1451
1556
|
}, /*#__PURE__*/_react["default"].createElement("track", {
|
|
1452
1557
|
kind: "captions"
|
|
1453
1558
|
}), 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", {
|
|
1454
|
-
key: "".concat(this.state.annotationsVersion),
|
|
1559
|
+
key: "".concat(this.state.annotationsVersion, "-").concat(this.state.svgSize.width, "x").concat(this.state.svgSize.height, "-").concat(this.state.calculatedHeight),
|
|
1455
1560
|
ref: this.props.playerSvgRef,
|
|
1456
1561
|
onMouseDown: this.props.handleMouseDown,
|
|
1457
1562
|
onMouseMove: this.props.handleMouseMove,
|
|
1458
1563
|
onMouseUp: this.props.handleMouseUp,
|
|
1459
1564
|
style: {
|
|
1460
1565
|
position: 'absolute',
|
|
1461
|
-
top: 0,
|
|
1462
|
-
left: 0,
|
|
1463
|
-
width: '100%',
|
|
1464
|
-
height: '100%',
|
|
1566
|
+
top: this.isFullscreenWithRightMenu() ? '50%' : 0,
|
|
1567
|
+
left: this.isFullscreenWithRightMenu() ? '50%' : 0,
|
|
1568
|
+
width: this.isFullscreenWithRightMenu() ? this.state.svgSize.width : '100%',
|
|
1569
|
+
height: this.isFullscreenWithRightMenu() ? "".concat(this.state.calculatedHeight) : '100%',
|
|
1465
1570
|
pointerEvents: this.state.shouldShowAnnotate ? 'auto' : 'none',
|
|
1466
|
-
zIndex: 1
|
|
1571
|
+
zIndex: 1,
|
|
1572
|
+
transform: this.isFullscreenWithRightMenu() ? 'translate(-50%, -50%)' : 'none'
|
|
1467
1573
|
}
|
|
1468
1574
|
}, ((_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) {
|
|
1469
|
-
var
|
|
1470
|
-
var svg = (
|
|
1575
|
+
var _this7$props$playerSv;
|
|
1576
|
+
var svg = (_this7$props$playerSv = _this7.props.playerSvgRef) === null || _this7$props$playerSv === void 0 ? void 0 : _this7$props$playerSv.current;
|
|
1471
1577
|
if (!svg) return null;
|
|
1472
1578
|
var svgData = svg.getBoundingClientRect();
|
|
1473
1579
|
var width = svgData.width;
|
|
@@ -1487,10 +1593,10 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1487
1593
|
strokeWidth: "4",
|
|
1488
1594
|
fill: "none",
|
|
1489
1595
|
onMouseDown: function onMouseDown(e) {
|
|
1490
|
-
return
|
|
1596
|
+
return _this7.props.onShapeMouseDown(e, idx, ann);
|
|
1491
1597
|
},
|
|
1492
1598
|
style: {
|
|
1493
|
-
cursor:
|
|
1599
|
+
cursor: _this7.props.isSvgLayer ? 'move' : 'default'
|
|
1494
1600
|
}
|
|
1495
1601
|
});
|
|
1496
1602
|
} else if (ann.type === 'line' || ann.type === 'arrow') {
|
|
@@ -1508,25 +1614,25 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1508
1614
|
strokeWidth: "4",
|
|
1509
1615
|
markerEnd: ann.type === 'arrow' ? "url(#open-arrowhead-".concat(ann.color.replace('#', ''), "-").concat(idx, ")") : undefined,
|
|
1510
1616
|
onMouseDown: function onMouseDown(e) {
|
|
1511
|
-
return
|
|
1617
|
+
return _this7.props.onShapeMouseDown(e, idx, ann);
|
|
1512
1618
|
},
|
|
1513
1619
|
style: {
|
|
1514
1620
|
color: ann.color,
|
|
1515
|
-
cursor:
|
|
1621
|
+
cursor: _this7.props.isSvgLayer ? 'move' : 'default'
|
|
1516
1622
|
}
|
|
1517
1623
|
});
|
|
1518
1624
|
} else if (ann.type === 'pencil') {
|
|
1519
1625
|
return /*#__PURE__*/_react["default"].createElement("path", {
|
|
1520
1626
|
key: idx,
|
|
1521
|
-
d:
|
|
1627
|
+
d: _this7.buildSmoothPath(ann.points, width, height),
|
|
1522
1628
|
stroke: ann.color,
|
|
1523
1629
|
strokeWidth: "4",
|
|
1524
1630
|
fill: "none",
|
|
1525
1631
|
onMouseDown: function onMouseDown(e) {
|
|
1526
|
-
return
|
|
1632
|
+
return _this7.props.onShapeMouseDown(e, idx, ann);
|
|
1527
1633
|
},
|
|
1528
1634
|
style: {
|
|
1529
|
-
cursor:
|
|
1635
|
+
cursor: _this7.props.isSvgLayer ? 'move' : 'default'
|
|
1530
1636
|
}
|
|
1531
1637
|
});
|
|
1532
1638
|
}
|
|
@@ -1558,11 +1664,11 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1558
1664
|
id: "outer",
|
|
1559
1665
|
currentSubtitleObj: currentSubtitleObj,
|
|
1560
1666
|
onClick: function onClick() {
|
|
1561
|
-
return
|
|
1667
|
+
return _this7.handleSubtitleContainerClick();
|
|
1562
1668
|
}
|
|
1563
1669
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
1564
1670
|
onClick: function onClick(e) {
|
|
1565
|
-
return
|
|
1671
|
+
return _this7.handleSubtitleClick(e);
|
|
1566
1672
|
},
|
|
1567
1673
|
className: "subtitleContainer longSubtitleStyles",
|
|
1568
1674
|
style: _objectSpread({}, currentSubtitleObj.style)
|
|
@@ -1584,6 +1690,7 @@ var Video = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
1584
1690
|
}) || null)));
|
|
1585
1691
|
}
|
|
1586
1692
|
}]);
|
|
1693
|
+
return Video;
|
|
1587
1694
|
}(_react.Component);
|
|
1588
1695
|
Video.propTypes = propTypes;
|
|
1589
1696
|
Video.defaultProps = defaultProps;
|