@desynova-digital/player 3.9.7 → 3.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Manager.js +26 -50
- package/actions/player.js +58 -89
- package/actions/video.js +70 -69
- package/colors.js +13 -13
- package/components/AudioMeter.js +138 -182
- package/components/BigPlayButton.js +48 -72
- package/components/ImageViewer.js +120 -165
- package/components/MarkerBar.js +64 -75
- package/components/Menu.js +30 -57
- package/components/Player.js +267 -327
- package/components/PlayerHeader.js +213 -348
- package/components/Playlist.js +50 -89
- package/components/PointersBar.js +131 -203
- package/components/PosterImage.js +12 -22
- package/components/SDOutline.js +32 -54
- package/components/Shortcut.js +135 -140
- package/components/Slider.js +85 -128
- package/components/TagsBar.js +45 -62
- package/components/Video.js +479 -655
- package/components/control-bar/AudioTracksMenuButton.js +63 -86
- package/components/control-bar/CameraButton.js +65 -76
- package/components/control-bar/CommentsButton.js +97 -136
- package/components/control-bar/ControlBar.js +171 -164
- package/components/control-bar/EditorControlMenuButton.js +180 -280
- package/components/control-bar/ForwardControl.js +7 -11
- package/components/control-bar/ForwardReplayControl.js +41 -55
- package/components/control-bar/FullscreenToggle.js +48 -67
- package/components/control-bar/PlayToggle.js +39 -54
- package/components/control-bar/ReplayControl.js +7 -11
- package/components/control-bar/SettingsMenuButton.js +19 -29
- package/components/control-bar/SubtitleLanguagesMenuButton.js +90 -119
- package/components/control-bar/SubtitleMovementMenu.js +128 -0
- package/components/control-bar/VolumeMenuButton.js +71 -96
- package/components/control-bar/ZoomMenuButton.js +57 -81
- package/components/marking-controls/MarkInControl.js +49 -65
- package/components/marking-controls/MarkOutControl.js +53 -69
- package/components/marking-controls/MarkingAddButton.js +41 -54
- package/components/marking-controls/MarkingControl.js +58 -107
- package/components/marking-controls/MarkingDeleteButton.js +39 -51
- package/components/marking-controls/MarkingDuration.js +23 -56
- package/components/marking-controls/MarkingPreview.js +39 -51
- package/components/progress-bar/AudioWaveform.js +48 -64
- package/components/progress-bar/LoadProgressBar.js +14 -37
- package/components/progress-bar/MouseTimeDisplay.js +14 -30
- package/components/progress-bar/PlayProgressBar.js +23 -41
- package/components/progress-bar/ProgressControl.js +82 -141
- package/components/progress-bar/SeekBar.js +101 -169
- package/components/progress-bar/Timeline.js +57 -81
- package/components/settings-menu-control/PlaybackRateControl.js +70 -115
- package/components/settings-menu-control/SafeAreaControl.js +49 -65
- package/components/settings-menu-control/SettingsMenu.js +26 -50
- package/components/time-controls/CurrentTimeDisplay.js +15 -34
- package/components/time-controls/DurationDisplay.js +14 -33
- package/components/time-controls/TimeDivider.js +12 -28
- package/components/volume-control/VolumeBar.js +84 -118
- package/components/volume-control/VolumeControl.js +7 -23
- package/components/volume-control/VolumeLevel.js +19 -36
- package/components/zoom-control/ZoomBar.js +79 -111
- package/components/zoom-control/ZoomLevel.js +24 -36
- package/index.js +204 -149
- package/package.json +5 -1
- package/reducers/index.js +12 -14
- package/reducers/operation.js +14 -14
- package/reducers/player.js +40 -42
- package/utils/browser.js +10 -5
- package/utils/dom.js +4 -15
- package/utils/fullscreen.js +24 -24
- package/utils/index.js +35 -46
package/components/Player.js
CHANGED
|
@@ -1,77 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
var _Shortcut2 = _interopRequireDefault(_Shortcut);
|
|
38
|
-
|
|
39
|
-
var _ControlBar = require('./control-bar/ControlBar');
|
|
40
|
-
|
|
41
|
-
var _ControlBar2 = _interopRequireDefault(_ControlBar);
|
|
42
|
-
|
|
43
|
-
var _ProgressControl = require('./progress-bar/ProgressControl');
|
|
44
|
-
|
|
45
|
-
var _ProgressControl2 = _interopRequireDefault(_ProgressControl);
|
|
46
|
-
|
|
47
|
-
var _PlayerHeader = require('./PlayerHeader');
|
|
48
|
-
|
|
49
|
-
var _PlayerHeader2 = _interopRequireDefault(_PlayerHeader);
|
|
50
|
-
|
|
51
|
-
var _Playlist = require('./Playlist');
|
|
52
|
-
|
|
53
|
-
var _Playlist2 = _interopRequireDefault(_Playlist);
|
|
54
|
-
|
|
55
|
-
var _AudioMeter = require('./AudioMeter');
|
|
56
|
-
|
|
57
|
-
var _AudioMeter2 = _interopRequireDefault(_AudioMeter);
|
|
58
|
-
|
|
59
|
-
var _utils = require('../utils');
|
|
60
|
-
|
|
61
|
-
var _fullscreen = require('../utils/fullscreen');
|
|
62
|
-
|
|
63
|
-
var _fullscreen2 = _interopRequireDefault(_fullscreen);
|
|
64
|
-
|
|
65
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
66
|
-
|
|
67
|
-
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
68
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _reactDom = require("react-dom");
|
|
12
|
+
var _Manager = _interopRequireDefault(require("../Manager"));
|
|
13
|
+
var _Video = _interopRequireDefault(require("./Video"));
|
|
14
|
+
var _ImageViewer = _interopRequireDefault(require("./ImageViewer"));
|
|
15
|
+
var _Shortcut = _interopRequireDefault(require("./Shortcut"));
|
|
16
|
+
var _ControlBar = _interopRequireDefault(require("./control-bar/ControlBar"));
|
|
17
|
+
var _ProgressControl = _interopRequireDefault(require("./progress-bar/ProgressControl"));
|
|
18
|
+
var _PlayerHeader = _interopRequireDefault(require("./PlayerHeader"));
|
|
19
|
+
var _Playlist = _interopRequireDefault(require("./Playlist"));
|
|
20
|
+
var _AudioMeter = _interopRequireDefault(require("./AudioMeter"));
|
|
21
|
+
var _utils = require("../utils");
|
|
22
|
+
var _fullscreen = _interopRequireDefault(require("../utils/fullscreen"));
|
|
23
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
28
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
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); }
|
|
30
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
32
|
+
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; }
|
|
33
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
|
+
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; }
|
|
36
|
+
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); }
|
|
69
37
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
70
|
-
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
function
|
|
74
|
-
|
|
38
|
+
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); } }
|
|
39
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
40
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
41
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
42
|
+
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); }
|
|
43
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
44
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
45
|
+
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); }
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
48
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
75
50
|
var propTypes = {
|
|
76
51
|
store: _propTypes.PropTypes.instanceOf(Object),
|
|
77
52
|
width: _propTypes.PropTypes.oneOfType([_propTypes.PropTypes.string, _propTypes.PropTypes.number]),
|
|
@@ -132,7 +107,6 @@ var propTypes = {
|
|
|
132
107
|
transcriptArr: _propTypes.PropTypes.instanceOf(Array),
|
|
133
108
|
tagsMarker: _propTypes.PropTypes.instanceOf(Array)
|
|
134
109
|
};
|
|
135
|
-
|
|
136
110
|
var defaultProps = {
|
|
137
111
|
fluid: true,
|
|
138
112
|
muted: false,
|
|
@@ -180,16 +154,8 @@ var defaultProps = {
|
|
|
180
154
|
onRateChange: null,
|
|
181
155
|
onVolumeChange: null
|
|
182
156
|
};
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
displayName: 'Player__PlayerBlock',
|
|
186
|
-
componentId: 'sc-1xon7ai-0'
|
|
187
|
-
})(['height:100%;']);
|
|
188
|
-
|
|
189
|
-
var PlayerContainer = _styledComponents2.default.div.withConfig({
|
|
190
|
-
displayName: 'Player__PlayerContainer',
|
|
191
|
-
componentId: 'sc-1xon7ai-1'
|
|
192
|
-
})(['display:flex;justify-content:flex-start;background:#000000;.left-video-section{width:', ';position:relative;}.audio-meter-block{position:relative;width:0px;display:none;&.qc{width:70px;display:block;}}.right-video-section{width:', ';position:relative;}'], function (props) {
|
|
157
|
+
var PlayerBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n"])));
|
|
158
|
+
var PlayerContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-start;\n background: #000000;\n .left-video-section {\n width: ", ";\n position: relative;\n }\n .audio-meter-block {\n position: relative;\n width: 0px;\n display: none;\n &.qc {\n width: 70px;\n display: block;\n }\n }\n .right-video-section {\n width: ", ";\n position: relative;\n }\n"])), function (props) {
|
|
193
159
|
if (props.hasRightSection) {
|
|
194
160
|
return '63.67%';
|
|
195
161
|
} else {
|
|
@@ -202,11 +168,7 @@ var PlayerContainer = _styledComponents2.default.div.withConfig({
|
|
|
202
168
|
return '36.33%';
|
|
203
169
|
}
|
|
204
170
|
});
|
|
205
|
-
|
|
206
|
-
var AudioMeterBlock = (0, _styledComponents2.default)('div').withConfig({
|
|
207
|
-
displayName: 'Player__AudioMeterBlock',
|
|
208
|
-
componentId: 'sc-1xon7ai-2'
|
|
209
|
-
})(['width:', ';height:', ';position:absolute;bottom:', ';left:', ';padding:', ';box-sizing:border-box;background:', ';border-radius:', ';display:', ';margin:', ';transition:all 0.1s ease-in-out;-moz-transition:all 0.1s ease-in-out;-webkit-transition:all 0.1s ease-in-out;-ms-transition:all 0.1s ease-in-out;-o-transition:all 0.1s ease-in-out;'], function (props) {
|
|
171
|
+
var AudioMeterBlock = (0, _styledComponents["default"])('div')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n position: absolute;\n bottom: ", ";\n left: ", ";\n padding: ", ";\n box-sizing: border-box;\n background: ", ";\n border-radius: ", ";\n display: ", ";\n margin: ", ";\n transition: all 0.1s ease-in-out;\n -moz-transition: all 0.1s ease-in-out;\n -webkit-transition: all 0.1s ease-in-out;\n -ms-transition: all 0.1s ease-in-out;\n -o-transition: all 0.1s ease-in-out;\n"])), function (props) {
|
|
210
172
|
return !props.active ? '50px' : '55px';
|
|
211
173
|
}, function (props) {
|
|
212
174
|
return !props.active ? '50px !important' : 'calc(100% - 40px)';
|
|
@@ -225,43 +187,35 @@ var AudioMeterBlock = (0, _styledComponents2.default)('div').withConfig({
|
|
|
225
187
|
}, function (props) {
|
|
226
188
|
return !props.active ? '0' : '20px 0';
|
|
227
189
|
});
|
|
228
|
-
|
|
229
|
-
var
|
|
230
|
-
displayName: 'Player__ControlContainer',
|
|
231
|
-
componentId: 'sc-1xon7ai-3'
|
|
232
|
-
})(['']);
|
|
233
|
-
|
|
234
|
-
var Player = function (_Component) {
|
|
190
|
+
var ControlContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral([""])));
|
|
191
|
+
var Player = /*#__PURE__*/function (_Component) {
|
|
235
192
|
_inherits(Player, _Component);
|
|
236
|
-
|
|
193
|
+
var _super = _createSuper(Player);
|
|
237
194
|
function Player(props) {
|
|
195
|
+
var _this;
|
|
238
196
|
_classCallCheck(this, Player);
|
|
239
|
-
|
|
240
|
-
var _this = _possibleConstructorReturn(this, (Player.__proto__ || Object.getPrototypeOf(Player)).call(this, props));
|
|
241
|
-
|
|
197
|
+
_this = _super.call(this, props);
|
|
242
198
|
_this.controlsHideTimer = null;
|
|
243
199
|
_this.meterHeight = 40;
|
|
244
200
|
_this.video = null; // the Video component
|
|
245
|
-
_this.manager = new
|
|
201
|
+
_this.manager = new _Manager["default"](props.store);
|
|
246
202
|
_this.actions = _this.manager.getActions();
|
|
247
|
-
_this.manager.subscribeToPlayerStateChange(_this.handleStateChange.bind(_this));
|
|
248
|
-
_this.handleResize = _this.handleResize.bind(_this);
|
|
249
|
-
_this.getChildren = _this.getChildren.bind(_this);
|
|
250
|
-
_this.handleFullScreenChange = _this.handleFullScreenChange.bind(_this);
|
|
251
|
-
_this.handleFocus = _this.handleFocus.bind(_this);
|
|
252
|
-
_this.handleBlur = _this.handleBlur.bind(_this);
|
|
203
|
+
_this.manager.subscribeToPlayerStateChange(_this.handleStateChange.bind(_assertThisInitialized(_this)));
|
|
204
|
+
_this.handleResize = _this.handleResize.bind(_assertThisInitialized(_this));
|
|
205
|
+
_this.getChildren = _this.getChildren.bind(_assertThisInitialized(_this));
|
|
206
|
+
_this.handleFullScreenChange = _this.handleFullScreenChange.bind(_assertThisInitialized(_this));
|
|
207
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
208
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
253
209
|
_this.actions.handlePlayerType(props.playerType);
|
|
254
210
|
_this.actions.handleControlType(props.controlType);
|
|
255
211
|
return _this;
|
|
256
212
|
}
|
|
257
|
-
|
|
258
213
|
_createClass(Player, [{
|
|
259
|
-
key:
|
|
214
|
+
key: "componentDidMount",
|
|
260
215
|
value: function componentDidMount() {
|
|
261
216
|
this.handleResize();
|
|
262
217
|
window.addEventListener('resize', this.handleResize);
|
|
263
|
-
|
|
264
|
-
_fullscreen2.default.addEventListener(this.handleFullScreenChange);
|
|
218
|
+
_fullscreen["default"].addEventListener(this.handleFullScreenChange);
|
|
265
219
|
/*
|
|
266
220
|
* const { player } = this.manager.getState();
|
|
267
221
|
* this.actions.toggleFullscreen(player);
|
|
@@ -290,38 +244,62 @@ var Player = function (_Component) {
|
|
|
290
244
|
// return false;
|
|
291
245
|
// }
|
|
292
246
|
// }
|
|
293
|
-
|
|
294
247
|
}, {
|
|
295
|
-
key:
|
|
296
|
-
value:
|
|
297
|
-
|
|
248
|
+
key: "shouldComponentUpdate",
|
|
249
|
+
value:
|
|
250
|
+
// shouldComponentUpdate(nextProps) {
|
|
251
|
+
// // Rendering the component only if
|
|
252
|
+
// // passed props value is changed
|
|
253
|
+
|
|
254
|
+
// const replacerFunc = () => {
|
|
255
|
+
// const visited = new WeakSet();
|
|
256
|
+
// return (key, value) => {
|
|
257
|
+
// if (typeof value === "object" && value !== null) {
|
|
258
|
+
// if (visited.has(value)) {
|
|
259
|
+
// return;
|
|
260
|
+
// }
|
|
261
|
+
// visited.add(value);
|
|
262
|
+
// }
|
|
263
|
+
// return value;
|
|
264
|
+
// };
|
|
265
|
+
// };
|
|
266
|
+
|
|
267
|
+
// if ( JSON.stringify(nextProps, replacerFunc()) !== JSON.stringify(this.props, replacerFunc()) ) {
|
|
268
|
+
// return true;
|
|
269
|
+
// } else {
|
|
270
|
+
// return false;
|
|
271
|
+
// }
|
|
272
|
+
// }
|
|
273
|
+
|
|
274
|
+
function shouldComponentUpdate(nextProps, nextState) {
|
|
275
|
+
if (_.isEqual(nextProps.markers, this.props.markers)) {
|
|
298
276
|
return false;
|
|
299
277
|
}
|
|
300
278
|
return true;
|
|
301
279
|
}
|
|
302
280
|
}, {
|
|
303
|
-
key:
|
|
281
|
+
key: "componentDidUpdate",
|
|
304
282
|
value: function componentDidUpdate() {
|
|
305
283
|
this.handleResize();
|
|
306
284
|
}
|
|
307
285
|
}, {
|
|
308
|
-
key:
|
|
286
|
+
key: "componentWillUnmount",
|
|
309
287
|
value: function componentWillUnmount() {
|
|
310
288
|
// Remove event listener
|
|
311
289
|
window.removeEventListener('resize', this.handleResize);
|
|
312
|
-
|
|
290
|
+
_fullscreen["default"].removeEventListener(this.handleFullScreenChange);
|
|
313
291
|
if (this.controlsHideTimer) {
|
|
314
292
|
window.clearTimeout(this.controlsHideTimer);
|
|
315
293
|
}
|
|
316
294
|
}
|
|
317
295
|
}, {
|
|
318
|
-
key:
|
|
296
|
+
key: "onTagsReset",
|
|
319
297
|
value: function onTagsReset() {
|
|
320
298
|
this.actions.handleVideoPreview(false);
|
|
321
299
|
this.actions.handleMarkerPointChange('delete');
|
|
322
300
|
}
|
|
323
301
|
}, {
|
|
324
|
-
key:
|
|
302
|
+
key: "onSegmentClick",
|
|
325
303
|
value: function onSegmentClick(start_time, end_time, seek) {
|
|
326
304
|
this.actions.handleMarkerUpdate(start_time, end_time);
|
|
327
305
|
seek ? this.actions.pause() : this.actions.play();
|
|
@@ -330,57 +308,61 @@ var Player = function (_Component) {
|
|
|
330
308
|
this.actions.handleVideoPreview(true);
|
|
331
309
|
}
|
|
332
310
|
}, {
|
|
333
|
-
key:
|
|
311
|
+
key: "getDefaultChildren",
|
|
334
312
|
value: function getDefaultChildren(props, fullProps) {
|
|
335
313
|
var _this2 = this;
|
|
336
|
-
|
|
337
|
-
return [_react2.default.createElement(_PlayerHeader2.default, _extends({
|
|
314
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
338
315
|
ref: function ref(c) {
|
|
339
316
|
_this2._playerHeader = c;
|
|
340
317
|
},
|
|
341
|
-
key:
|
|
318
|
+
key: "video-header",
|
|
342
319
|
order: 1
|
|
343
|
-
}, fullProps)),
|
|
320
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_Video["default"], _extends({
|
|
344
321
|
ref: function ref(c) {
|
|
345
322
|
_this2.video = c;
|
|
346
323
|
_this2.manager.video = _this2.video;
|
|
347
324
|
},
|
|
348
|
-
key:
|
|
325
|
+
key: "video",
|
|
349
326
|
order: 2
|
|
350
|
-
}, fullProps)),
|
|
327
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ProgressControl["default"], _extends({
|
|
351
328
|
ref: function ref(c) {
|
|
352
329
|
_this2._progressControl = c;
|
|
353
330
|
}
|
|
354
331
|
}, this.props, {
|
|
355
|
-
key:
|
|
332
|
+
key: "progress-control",
|
|
356
333
|
order: 3
|
|
357
|
-
})),
|
|
334
|
+
})), /*#__PURE__*/_react["default"].createElement(_ControlBar["default"], _extends({
|
|
358
335
|
ref: function ref(c) {
|
|
359
336
|
_this2._controlBar = c;
|
|
360
337
|
},
|
|
361
|
-
key:
|
|
338
|
+
key: "control-bar",
|
|
362
339
|
order: 4
|
|
363
|
-
}, this.props)),
|
|
340
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
|
|
341
|
+
key: "shortcut",
|
|
342
|
+
order: 99.0
|
|
343
|
+
}, props, {
|
|
344
|
+
frameRate: fullProps.frameRate
|
|
345
|
+
}))];
|
|
364
346
|
}
|
|
365
347
|
}, {
|
|
366
|
-
key:
|
|
348
|
+
key: "getImageChildren",
|
|
367
349
|
value: function getImageChildren(props, fullProps) {
|
|
368
350
|
var _this3 = this;
|
|
369
|
-
|
|
370
|
-
return [_react2.default.createElement(_PlayerHeader2.default, _extends({
|
|
351
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
371
352
|
ref: function ref(c) {
|
|
372
353
|
_this3._playerHeader = c;
|
|
373
354
|
},
|
|
374
|
-
key:
|
|
355
|
+
key: "video-header",
|
|
375
356
|
order: 1
|
|
376
|
-
}, fullProps)),
|
|
357
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ImageViewer["default"], _extends({
|
|
377
358
|
ref: function ref(c) {
|
|
378
359
|
_this3.video = c;
|
|
379
360
|
_this3.manager.video = _this3.video;
|
|
380
361
|
},
|
|
381
|
-
key:
|
|
362
|
+
key: "image",
|
|
382
363
|
order: 0.0
|
|
383
364
|
}, fullProps)),
|
|
365
|
+
/*#__PURE__*/
|
|
384
366
|
/*
|
|
385
367
|
* <ControlBar
|
|
386
368
|
* ref={(c) => {
|
|
@@ -391,39 +373,46 @@ var Player = function (_Component) {
|
|
|
391
373
|
* {...this.props}
|
|
392
374
|
* />,
|
|
393
375
|
*/
|
|
394
|
-
|
|
376
|
+
_react["default"].createElement(_Shortcut["default"], _extends({
|
|
377
|
+
key: "shortcut",
|
|
378
|
+
order: 99.0
|
|
379
|
+
}, props))];
|
|
395
380
|
}
|
|
396
381
|
}, {
|
|
397
|
-
key:
|
|
382
|
+
key: "getAdvancedChildren",
|
|
398
383
|
value: function getAdvancedChildren(props, fullProps) {
|
|
399
384
|
var _this4 = this;
|
|
400
|
-
|
|
401
|
-
return [_react2.default.createElement(_PlayerHeader2.default, _extends({
|
|
385
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
402
386
|
ref: function ref(c) {
|
|
403
387
|
_this4._playerHeader = c;
|
|
404
388
|
},
|
|
405
|
-
key:
|
|
389
|
+
key: "video-header",
|
|
406
390
|
order: 1
|
|
407
|
-
}, fullProps)),
|
|
391
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_Video["default"], _extends({
|
|
408
392
|
ref: function ref(c) {
|
|
409
393
|
_this4.video = c;
|
|
410
394
|
_this4.manager.video = _this4.video;
|
|
411
395
|
},
|
|
412
|
-
key:
|
|
396
|
+
key: "video",
|
|
413
397
|
order: 0.0
|
|
414
|
-
}, fullProps)),
|
|
398
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ControlBar["default"], _extends({
|
|
415
399
|
ref: function ref(c) {
|
|
416
400
|
_this4._controlBar = c;
|
|
417
401
|
},
|
|
418
|
-
key:
|
|
402
|
+
key: "control-bar",
|
|
419
403
|
order: 2
|
|
420
|
-
}, this.props)),
|
|
404
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
|
|
405
|
+
key: "shortcut",
|
|
406
|
+
order: 99.0
|
|
407
|
+
}, props, {
|
|
408
|
+
frameRate: fullProps.frameRate
|
|
409
|
+
}))];
|
|
421
410
|
}
|
|
422
411
|
}, {
|
|
423
|
-
key:
|
|
412
|
+
key: "getChildren",
|
|
424
413
|
value: function getChildren(props, position) {
|
|
425
414
|
if (position === 'left') {
|
|
426
|
-
var _propsWithoutChildren =
|
|
415
|
+
var _propsWithoutChildren = _objectSpread(_objectSpread({}, props), {}, {
|
|
427
416
|
children: null
|
|
428
417
|
});
|
|
429
418
|
var _children = [];
|
|
@@ -437,7 +426,7 @@ var Player = function (_Component) {
|
|
|
437
426
|
}
|
|
438
427
|
return (0, _utils.mergeAndSortChildren)(_defaultChildren, _children, _propsWithoutChildren);
|
|
439
428
|
}
|
|
440
|
-
var propsWithoutChildren =
|
|
429
|
+
var propsWithoutChildren = _objectSpread(_objectSpread({}, props), {}, {
|
|
441
430
|
children: null
|
|
442
431
|
});
|
|
443
432
|
var children = [];
|
|
@@ -448,108 +437,135 @@ var Player = function (_Component) {
|
|
|
448
437
|
* get redux state
|
|
449
438
|
* { player, operation }
|
|
450
439
|
*/
|
|
451
|
-
|
|
452
440
|
}, {
|
|
453
|
-
key:
|
|
441
|
+
key: "getState",
|
|
454
442
|
value: function getState() {
|
|
455
443
|
return this.manager.getState();
|
|
456
444
|
}
|
|
457
445
|
|
|
458
446
|
// get playback rate
|
|
447
|
+
}, {
|
|
448
|
+
key: "playbackRate",
|
|
449
|
+
get: function get() {
|
|
450
|
+
return this.video.playbackRate;
|
|
451
|
+
}
|
|
459
452
|
|
|
453
|
+
/*
|
|
454
|
+
* set playback rate
|
|
455
|
+
* speed of video
|
|
456
|
+
*/,
|
|
457
|
+
set: function set(rate) {
|
|
458
|
+
this.video.playbackRate = rate;
|
|
459
|
+
}
|
|
460
460
|
}, {
|
|
461
|
-
key:
|
|
461
|
+
key: "muted",
|
|
462
|
+
get: function get() {
|
|
463
|
+
return this.video.muted;
|
|
464
|
+
},
|
|
465
|
+
set: function set(val) {
|
|
466
|
+
this.video.muted = val;
|
|
467
|
+
}
|
|
468
|
+
}, {
|
|
469
|
+
key: "volume",
|
|
470
|
+
get: function get() {
|
|
471
|
+
return this.video.volume;
|
|
472
|
+
},
|
|
473
|
+
set: function set(val) {
|
|
474
|
+
this.video.volume = val;
|
|
475
|
+
}
|
|
462
476
|
|
|
477
|
+
// video width
|
|
478
|
+
}, {
|
|
479
|
+
key: "videoWidth",
|
|
480
|
+
get: function get() {
|
|
481
|
+
return this.video.videoWidth;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// video height
|
|
485
|
+
}, {
|
|
486
|
+
key: "videoHeight",
|
|
487
|
+
get: function get() {
|
|
488
|
+
return this.video.videoHeight;
|
|
489
|
+
}
|
|
463
490
|
|
|
464
491
|
// play the video
|
|
492
|
+
}, {
|
|
493
|
+
key: "play",
|
|
465
494
|
value: function play() {
|
|
466
495
|
this.video.play();
|
|
467
496
|
}
|
|
468
497
|
|
|
469
498
|
// pause the video
|
|
470
|
-
|
|
471
499
|
}, {
|
|
472
|
-
key:
|
|
500
|
+
key: "pause",
|
|
473
501
|
value: function pause() {
|
|
474
502
|
this.video.pause();
|
|
475
503
|
}
|
|
476
504
|
|
|
477
505
|
// Change the video source and re-load the video:
|
|
478
|
-
|
|
479
506
|
}, {
|
|
480
|
-
key:
|
|
507
|
+
key: "load",
|
|
481
508
|
value: function load() {
|
|
482
509
|
this.video.load();
|
|
483
510
|
}
|
|
484
511
|
|
|
485
512
|
// Add a new text track to the video
|
|
486
|
-
|
|
487
513
|
}, {
|
|
488
|
-
key:
|
|
514
|
+
key: "addTextTrack",
|
|
489
515
|
value: function addTextTrack() {
|
|
490
|
-
var
|
|
491
|
-
|
|
492
|
-
(_video = this.video).addTextTrack.apply(_video, arguments);
|
|
516
|
+
var _this$video;
|
|
517
|
+
(_this$video = this.video).addTextTrack.apply(_this$video, arguments);
|
|
493
518
|
}
|
|
494
519
|
|
|
495
520
|
// Check if your browser can play different types of video:
|
|
496
|
-
|
|
497
521
|
}, {
|
|
498
|
-
key:
|
|
522
|
+
key: "canPlayType",
|
|
499
523
|
value: function canPlayType() {
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
(_video2 = this.video).canPlayType.apply(_video2, arguments);
|
|
524
|
+
var _this$video2;
|
|
525
|
+
(_this$video2 = this.video).canPlayType.apply(_this$video2, arguments);
|
|
503
526
|
}
|
|
504
527
|
|
|
505
528
|
// seek video by time
|
|
506
|
-
|
|
507
529
|
}, {
|
|
508
|
-
key:
|
|
530
|
+
key: "seek",
|
|
509
531
|
value: function seek(time) {
|
|
510
532
|
this.video.seek(time);
|
|
511
533
|
}
|
|
512
534
|
|
|
513
535
|
// jump forward x seconds
|
|
514
|
-
|
|
515
536
|
}, {
|
|
516
|
-
key:
|
|
537
|
+
key: "forward",
|
|
517
538
|
value: function forward(seconds) {
|
|
518
539
|
this.video.forward(seconds);
|
|
519
540
|
}
|
|
520
541
|
|
|
521
542
|
// jump back x seconds
|
|
522
|
-
|
|
523
543
|
}, {
|
|
524
|
-
key:
|
|
544
|
+
key: "replay",
|
|
525
545
|
value: function replay(seconds) {
|
|
526
546
|
this.video.replay(seconds);
|
|
527
547
|
}
|
|
528
548
|
|
|
529
549
|
// enter or exist full screen
|
|
530
|
-
|
|
531
550
|
}, {
|
|
532
|
-
key:
|
|
551
|
+
key: "toggleFullscreen",
|
|
533
552
|
value: function toggleFullscreen() {
|
|
534
553
|
this.video.toggleFullscreen();
|
|
535
554
|
}
|
|
536
555
|
|
|
537
556
|
// subscribe to player state change
|
|
538
|
-
|
|
539
557
|
}, {
|
|
540
|
-
key:
|
|
558
|
+
key: "subscribeToStateChange",
|
|
541
559
|
value: function subscribeToStateChange(listener) {
|
|
542
560
|
return this.manager.subscribeToPlayerStateChange(listener);
|
|
543
561
|
}
|
|
544
562
|
|
|
545
563
|
// player resize
|
|
546
|
-
|
|
547
564
|
}, {
|
|
548
|
-
key:
|
|
565
|
+
key: "handleResize",
|
|
549
566
|
value: function handleResize() {
|
|
550
|
-
var
|
|
551
|
-
|
|
552
|
-
|
|
567
|
+
var _this$manager$getStat = this.manager.getState(),
|
|
568
|
+
player = _this$manager$getStat.player;
|
|
553
569
|
var leftSectionRef = this._leftSectionRef;
|
|
554
570
|
var rightSectionRef = this._rightSectionRef;
|
|
555
571
|
var audioMeterBlock = this._audioMeterBlock;
|
|
@@ -559,13 +575,12 @@ var Player = function (_Component) {
|
|
|
559
575
|
var controlBar = (0, _reactDom.findDOMNode)(this._controlBar);
|
|
560
576
|
var playlist = (0, _reactDom.findDOMNode)(this._playlist);
|
|
561
577
|
var playerContainer = (0, _reactDom.findDOMNode)(this._playerContainer);
|
|
562
|
-
var
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
578
|
+
var _this$props = this.props,
|
|
579
|
+
controlType = _this$props.controlType,
|
|
580
|
+
playerType = _this$props.playerType,
|
|
581
|
+
fileType = _this$props.fileType;
|
|
567
582
|
var height = 0;
|
|
568
|
-
|
|
583
|
+
_toConsumableArray(leftSectionRef.children).forEach(function (child) {
|
|
569
584
|
return height += child.offsetHeight;
|
|
570
585
|
});
|
|
571
586
|
if (rightSectionRef) {
|
|
@@ -640,12 +655,12 @@ var Player = function (_Component) {
|
|
|
640
655
|
// this.video.handleResize();
|
|
641
656
|
}
|
|
642
657
|
}, {
|
|
643
|
-
key:
|
|
658
|
+
key: "handleFullScreenChange",
|
|
644
659
|
value: function handleFullScreenChange() {
|
|
645
|
-
this.actions.handleFullscreenChange(
|
|
660
|
+
this.actions.handleFullscreenChange(_fullscreen["default"].isFullscreen);
|
|
646
661
|
}
|
|
647
662
|
}, {
|
|
648
|
-
key:
|
|
663
|
+
key: "handleStateChange",
|
|
649
664
|
value: function handleStateChange(state, prevState) {
|
|
650
665
|
if (state.isFullscreen !== prevState.isFullscreen) {
|
|
651
666
|
this.handleResize();
|
|
@@ -653,24 +668,24 @@ var Player = function (_Component) {
|
|
|
653
668
|
this.forceUpdate(); // re-render
|
|
654
669
|
}
|
|
655
670
|
}, {
|
|
656
|
-
key:
|
|
671
|
+
key: "handleFocus",
|
|
657
672
|
value: function handleFocus() {
|
|
658
673
|
this.actions.activate(true);
|
|
659
674
|
}
|
|
660
675
|
}, {
|
|
661
|
-
key:
|
|
676
|
+
key: "handleBlur",
|
|
662
677
|
value: function handleBlur() {
|
|
663
678
|
this.actions.activate(false);
|
|
664
679
|
}
|
|
665
680
|
}, {
|
|
666
|
-
key:
|
|
681
|
+
key: "render",
|
|
667
682
|
value: function render() {
|
|
668
683
|
var _this5 = this;
|
|
684
|
+
var _this$manager$getStat2 = this.manager.getState(),
|
|
685
|
+
player = _this$manager$getStat2.player;
|
|
686
|
+
// console.log("justttttttttttt");
|
|
669
687
|
|
|
670
|
-
var
|
|
671
|
-
player = _manager$getState2.player;
|
|
672
|
-
|
|
673
|
-
var props = _extends({}, this.props, {
|
|
688
|
+
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
674
689
|
player: player,
|
|
675
690
|
actions: this.actions,
|
|
676
691
|
manager: this.manager,
|
|
@@ -678,144 +693,69 @@ var Player = function (_Component) {
|
|
|
678
693
|
video: this.video ? this.video.video : null
|
|
679
694
|
});
|
|
680
695
|
var childrensLeft = this.getChildren(props, 'left');
|
|
681
|
-
var
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
PlayerBlock,
|
|
688
|
-
{
|
|
689
|
-
ref: function ref(c) {
|
|
690
|
-
_this5.manager.rootElement = c;
|
|
691
|
-
},
|
|
692
|
-
role: 'region',
|
|
693
|
-
onFocus: this.handleFocus,
|
|
694
|
-
onBlur: this.handleBlur,
|
|
695
|
-
tabIndex: '-1'
|
|
696
|
+
var _this$props2 = this.props,
|
|
697
|
+
rightSection = _this$props2.rightSection,
|
|
698
|
+
playerType = _this$props2.playerType;
|
|
699
|
+
return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
|
|
700
|
+
ref: function ref(c) {
|
|
701
|
+
_this5.manager.rootElement = c;
|
|
696
702
|
},
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
) : null
|
|
746
|
-
),
|
|
747
|
-
props.controlType === 'advanced' ? _react2.default.createElement(
|
|
748
|
-
ControlContainer,
|
|
749
|
-
{
|
|
750
|
-
ref: function ref(advancedControl) {
|
|
751
|
-
_this5._advancedControl = advancedControl;
|
|
752
|
-
}
|
|
753
|
-
},
|
|
754
|
-
_react2.default.createElement(_ProgressControl2.default, _extends({}, props, { key: 'progress-control', order: 1 }))
|
|
755
|
-
) : _react2.default.createElement(_Playlist2.default, _extends({
|
|
756
|
-
ref: function ref(c) {
|
|
757
|
-
_this5._playlist = c;
|
|
758
|
-
},
|
|
759
|
-
key: 'playlist',
|
|
760
|
-
order: 5
|
|
761
|
-
}, this.props))
|
|
762
|
-
);
|
|
763
|
-
}
|
|
764
|
-
}, {
|
|
765
|
-
key: 'playbackRate',
|
|
766
|
-
get: function get() {
|
|
767
|
-
return this.video.playbackRate;
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
/*
|
|
771
|
-
* set playback rate
|
|
772
|
-
* speed of video
|
|
773
|
-
*/
|
|
774
|
-
,
|
|
775
|
-
set: function set(rate) {
|
|
776
|
-
this.video.playbackRate = rate;
|
|
777
|
-
}
|
|
778
|
-
}, {
|
|
779
|
-
key: 'muted',
|
|
780
|
-
get: function get() {
|
|
781
|
-
return this.video.muted;
|
|
782
|
-
},
|
|
783
|
-
set: function set(val) {
|
|
784
|
-
this.video.muted = val;
|
|
785
|
-
}
|
|
786
|
-
}, {
|
|
787
|
-
key: 'volume',
|
|
788
|
-
get: function get() {
|
|
789
|
-
return this.video.volume;
|
|
790
|
-
},
|
|
791
|
-
set: function set(val) {
|
|
792
|
-
this.video.volume = val;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
// video width
|
|
796
|
-
|
|
797
|
-
}, {
|
|
798
|
-
key: 'videoWidth',
|
|
799
|
-
get: function get() {
|
|
800
|
-
return this.video.videoWidth;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
// video height
|
|
804
|
-
|
|
805
|
-
}, {
|
|
806
|
-
key: 'videoHeight',
|
|
807
|
-
get: function get() {
|
|
808
|
-
return this.video.videoHeight;
|
|
703
|
+
role: "region",
|
|
704
|
+
onFocus: this.handleFocus,
|
|
705
|
+
onBlur: this.handleBlur,
|
|
706
|
+
tabIndex: "-1"
|
|
707
|
+
}, /*#__PURE__*/_react["default"].createElement(PlayerContainer, _extends({
|
|
708
|
+
ref: function ref(playerContainer) {
|
|
709
|
+
_this5._playerContainer = playerContainer;
|
|
710
|
+
}
|
|
711
|
+
}, props, {
|
|
712
|
+
hasRightSection: !!rightSection
|
|
713
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
714
|
+
className: "left-video-section",
|
|
715
|
+
ref: function ref(leftSectionRef) {
|
|
716
|
+
_this5._leftSectionRef = leftSectionRef;
|
|
717
|
+
}
|
|
718
|
+
}, childrensLeft), /*#__PURE__*/_react["default"].createElement("div", {
|
|
719
|
+
className: "audio-meter-block ".concat(playerType),
|
|
720
|
+
ref: function ref(audioMeterBlock) {
|
|
721
|
+
_this5._audioMeterBlock = audioMeterBlock;
|
|
722
|
+
}
|
|
723
|
+
}, /*#__PURE__*/_react["default"].createElement(AudioMeterBlock, {
|
|
724
|
+
onClick: function onClick() {
|
|
725
|
+
_this5.meterBlockClick();
|
|
726
|
+
},
|
|
727
|
+
role: "presentation",
|
|
728
|
+
active: true
|
|
729
|
+
}, /*#__PURE__*/_react["default"].createElement(_AudioMeter["default"], {
|
|
730
|
+
player: props.player,
|
|
731
|
+
height: this.meterHeight
|
|
732
|
+
}))), rightSection ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
733
|
+
className: "right-video-section",
|
|
734
|
+
ref: function ref(rightSectionRef) {
|
|
735
|
+
_this5._rightSectionRef = rightSectionRef;
|
|
736
|
+
}
|
|
737
|
+
}, rightSection) : null), props.controlType === 'advanced' ? /*#__PURE__*/_react["default"].createElement(ControlContainer, {
|
|
738
|
+
ref: function ref(advancedControl) {
|
|
739
|
+
_this5._advancedControl = advancedControl;
|
|
740
|
+
}
|
|
741
|
+
}, /*#__PURE__*/_react["default"].createElement(_ProgressControl["default"], _extends({}, props, {
|
|
742
|
+
key: "progress-control",
|
|
743
|
+
order: 1
|
|
744
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_Playlist["default"], _extends({
|
|
745
|
+
ref: function ref(c) {
|
|
746
|
+
_this5._playlist = c;
|
|
747
|
+
},
|
|
748
|
+
key: "playlist",
|
|
749
|
+
order: 5
|
|
750
|
+
}, this.props)));
|
|
809
751
|
}
|
|
810
752
|
}]);
|
|
811
|
-
|
|
812
753
|
return Player;
|
|
813
754
|
}(_react.Component);
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
Player.contextTypes = { store: _propTypes.PropTypes.instanceOf(Object) };
|
|
755
|
+
exports["default"] = Player;
|
|
756
|
+
Player.contextTypes = {
|
|
757
|
+
store: _propTypes.PropTypes.instanceOf(Object)
|
|
758
|
+
};
|
|
819
759
|
Player.propTypes = propTypes;
|
|
820
760
|
Player.defaultProps = defaultProps;
|
|
821
761
|
Player.displayName = 'Player';
|