@desynova-digital/player 3.9.7 → 3.9.9
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 +239 -357
- 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,103 +187,63 @@ 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);
|
|
268
222
|
*/
|
|
269
223
|
}
|
|
270
|
-
|
|
271
|
-
// shouldComponentUpdate(nextProps) {
|
|
272
|
-
// // Rendering the component only if passed props value is changed
|
|
273
|
-
|
|
274
|
-
// const replacerFunc = () => {
|
|
275
|
-
// const visited = new WeakSet();
|
|
276
|
-
// return (key, value) => {
|
|
277
|
-
// if (typeof value === 'object' && value !== null) {
|
|
278
|
-
// if (visited.has(value)) {
|
|
279
|
-
// return;
|
|
280
|
-
// }
|
|
281
|
-
// visited.add(value);
|
|
282
|
-
// }
|
|
283
|
-
// return value;
|
|
284
|
-
// };
|
|
285
|
-
// };
|
|
286
|
-
|
|
287
|
-
// if ( JSON.stringify(nextProps, replacerFunc()) !== JSON.stringify(this.props, replacerFunc()) ) {
|
|
288
|
-
// return true;
|
|
289
|
-
// } else {
|
|
290
|
-
// return false;
|
|
291
|
-
// }
|
|
292
|
-
// }
|
|
293
|
-
|
|
294
|
-
}, {
|
|
295
|
-
key: 'shouldComponentUpdate',
|
|
296
|
-
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
297
|
-
if (_.isEqual(nextProps, this.props)) {
|
|
298
|
-
return false;
|
|
299
|
-
}
|
|
300
|
-
return true;
|
|
301
|
-
}
|
|
302
224
|
}, {
|
|
303
|
-
key:
|
|
225
|
+
key: "componentDidUpdate",
|
|
304
226
|
value: function componentDidUpdate() {
|
|
305
227
|
this.handleResize();
|
|
306
228
|
}
|
|
307
229
|
}, {
|
|
308
|
-
key:
|
|
230
|
+
key: "componentWillUnmount",
|
|
309
231
|
value: function componentWillUnmount() {
|
|
310
232
|
// Remove event listener
|
|
311
233
|
window.removeEventListener('resize', this.handleResize);
|
|
312
|
-
|
|
234
|
+
_fullscreen["default"].removeEventListener(this.handleFullScreenChange);
|
|
313
235
|
if (this.controlsHideTimer) {
|
|
314
236
|
window.clearTimeout(this.controlsHideTimer);
|
|
315
237
|
}
|
|
316
238
|
}
|
|
317
239
|
}, {
|
|
318
|
-
key:
|
|
240
|
+
key: "onTagsReset",
|
|
319
241
|
value: function onTagsReset() {
|
|
320
242
|
this.actions.handleVideoPreview(false);
|
|
321
243
|
this.actions.handleMarkerPointChange('delete');
|
|
322
244
|
}
|
|
323
245
|
}, {
|
|
324
|
-
key:
|
|
246
|
+
key: "onSegmentClick",
|
|
325
247
|
value: function onSegmentClick(start_time, end_time, seek) {
|
|
326
248
|
this.actions.handleMarkerUpdate(start_time, end_time);
|
|
327
249
|
seek ? this.actions.pause() : this.actions.play();
|
|
@@ -330,57 +252,61 @@ var Player = function (_Component) {
|
|
|
330
252
|
this.actions.handleVideoPreview(true);
|
|
331
253
|
}
|
|
332
254
|
}, {
|
|
333
|
-
key:
|
|
255
|
+
key: "getDefaultChildren",
|
|
334
256
|
value: function getDefaultChildren(props, fullProps) {
|
|
335
257
|
var _this2 = this;
|
|
336
|
-
|
|
337
|
-
return [_react2.default.createElement(_PlayerHeader2.default, _extends({
|
|
258
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
338
259
|
ref: function ref(c) {
|
|
339
260
|
_this2._playerHeader = c;
|
|
340
261
|
},
|
|
341
|
-
key:
|
|
262
|
+
key: "video-header",
|
|
342
263
|
order: 1
|
|
343
|
-
}, fullProps)),
|
|
264
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_Video["default"], _extends({
|
|
344
265
|
ref: function ref(c) {
|
|
345
266
|
_this2.video = c;
|
|
346
267
|
_this2.manager.video = _this2.video;
|
|
347
268
|
},
|
|
348
|
-
key:
|
|
269
|
+
key: "video",
|
|
349
270
|
order: 2
|
|
350
|
-
}, fullProps)),
|
|
271
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ProgressControl["default"], _extends({
|
|
351
272
|
ref: function ref(c) {
|
|
352
273
|
_this2._progressControl = c;
|
|
353
274
|
}
|
|
354
275
|
}, this.props, {
|
|
355
|
-
key:
|
|
276
|
+
key: "progress-control",
|
|
356
277
|
order: 3
|
|
357
|
-
})),
|
|
278
|
+
})), /*#__PURE__*/_react["default"].createElement(_ControlBar["default"], _extends({
|
|
358
279
|
ref: function ref(c) {
|
|
359
280
|
_this2._controlBar = c;
|
|
360
281
|
},
|
|
361
|
-
key:
|
|
282
|
+
key: "control-bar",
|
|
362
283
|
order: 4
|
|
363
|
-
}, this.props)),
|
|
284
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
|
|
285
|
+
key: "shortcut",
|
|
286
|
+
order: 99.0
|
|
287
|
+
}, props, {
|
|
288
|
+
frameRate: fullProps.frameRate
|
|
289
|
+
}))];
|
|
364
290
|
}
|
|
365
291
|
}, {
|
|
366
|
-
key:
|
|
292
|
+
key: "getImageChildren",
|
|
367
293
|
value: function getImageChildren(props, fullProps) {
|
|
368
294
|
var _this3 = this;
|
|
369
|
-
|
|
370
|
-
return [_react2.default.createElement(_PlayerHeader2.default, _extends({
|
|
295
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
371
296
|
ref: function ref(c) {
|
|
372
297
|
_this3._playerHeader = c;
|
|
373
298
|
},
|
|
374
|
-
key:
|
|
299
|
+
key: "video-header",
|
|
375
300
|
order: 1
|
|
376
|
-
}, fullProps)),
|
|
301
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ImageViewer["default"], _extends({
|
|
377
302
|
ref: function ref(c) {
|
|
378
303
|
_this3.video = c;
|
|
379
304
|
_this3.manager.video = _this3.video;
|
|
380
305
|
},
|
|
381
|
-
key:
|
|
306
|
+
key: "image",
|
|
382
307
|
order: 0.0
|
|
383
308
|
}, fullProps)),
|
|
309
|
+
/*#__PURE__*/
|
|
384
310
|
/*
|
|
385
311
|
* <ControlBar
|
|
386
312
|
* ref={(c) => {
|
|
@@ -391,39 +317,46 @@ var Player = function (_Component) {
|
|
|
391
317
|
* {...this.props}
|
|
392
318
|
* />,
|
|
393
319
|
*/
|
|
394
|
-
|
|
320
|
+
_react["default"].createElement(_Shortcut["default"], _extends({
|
|
321
|
+
key: "shortcut",
|
|
322
|
+
order: 99.0
|
|
323
|
+
}, props))];
|
|
395
324
|
}
|
|
396
325
|
}, {
|
|
397
|
-
key:
|
|
326
|
+
key: "getAdvancedChildren",
|
|
398
327
|
value: function getAdvancedChildren(props, fullProps) {
|
|
399
328
|
var _this4 = this;
|
|
400
|
-
|
|
401
|
-
return [_react2.default.createElement(_PlayerHeader2.default, _extends({
|
|
329
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
402
330
|
ref: function ref(c) {
|
|
403
331
|
_this4._playerHeader = c;
|
|
404
332
|
},
|
|
405
|
-
key:
|
|
333
|
+
key: "video-header",
|
|
406
334
|
order: 1
|
|
407
|
-
}, fullProps)),
|
|
335
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_Video["default"], _extends({
|
|
408
336
|
ref: function ref(c) {
|
|
409
337
|
_this4.video = c;
|
|
410
338
|
_this4.manager.video = _this4.video;
|
|
411
339
|
},
|
|
412
|
-
key:
|
|
340
|
+
key: "video",
|
|
413
341
|
order: 0.0
|
|
414
|
-
}, fullProps)),
|
|
342
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ControlBar["default"], _extends({
|
|
415
343
|
ref: function ref(c) {
|
|
416
344
|
_this4._controlBar = c;
|
|
417
345
|
},
|
|
418
|
-
key:
|
|
346
|
+
key: "control-bar",
|
|
419
347
|
order: 2
|
|
420
|
-
}, this.props)),
|
|
348
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
|
|
349
|
+
key: "shortcut",
|
|
350
|
+
order: 99.0
|
|
351
|
+
}, props, {
|
|
352
|
+
frameRate: fullProps.frameRate
|
|
353
|
+
}))];
|
|
421
354
|
}
|
|
422
355
|
}, {
|
|
423
|
-
key:
|
|
356
|
+
key: "getChildren",
|
|
424
357
|
value: function getChildren(props, position) {
|
|
425
358
|
if (position === 'left') {
|
|
426
|
-
var _propsWithoutChildren =
|
|
359
|
+
var _propsWithoutChildren = _objectSpread(_objectSpread({}, props), {}, {
|
|
427
360
|
children: null
|
|
428
361
|
});
|
|
429
362
|
var _children = [];
|
|
@@ -437,7 +370,7 @@ var Player = function (_Component) {
|
|
|
437
370
|
}
|
|
438
371
|
return (0, _utils.mergeAndSortChildren)(_defaultChildren, _children, _propsWithoutChildren);
|
|
439
372
|
}
|
|
440
|
-
var propsWithoutChildren =
|
|
373
|
+
var propsWithoutChildren = _objectSpread(_objectSpread({}, props), {}, {
|
|
441
374
|
children: null
|
|
442
375
|
});
|
|
443
376
|
var children = [];
|
|
@@ -448,108 +381,135 @@ var Player = function (_Component) {
|
|
|
448
381
|
* get redux state
|
|
449
382
|
* { player, operation }
|
|
450
383
|
*/
|
|
451
|
-
|
|
452
384
|
}, {
|
|
453
|
-
key:
|
|
385
|
+
key: "getState",
|
|
454
386
|
value: function getState() {
|
|
455
387
|
return this.manager.getState();
|
|
456
388
|
}
|
|
457
389
|
|
|
458
390
|
// get playback rate
|
|
391
|
+
}, {
|
|
392
|
+
key: "playbackRate",
|
|
393
|
+
get: function get() {
|
|
394
|
+
return this.video.playbackRate;
|
|
395
|
+
}
|
|
459
396
|
|
|
397
|
+
/*
|
|
398
|
+
* set playback rate
|
|
399
|
+
* speed of video
|
|
400
|
+
*/,
|
|
401
|
+
set: function set(rate) {
|
|
402
|
+
this.video.playbackRate = rate;
|
|
403
|
+
}
|
|
404
|
+
}, {
|
|
405
|
+
key: "muted",
|
|
406
|
+
get: function get() {
|
|
407
|
+
return this.video.muted;
|
|
408
|
+
},
|
|
409
|
+
set: function set(val) {
|
|
410
|
+
this.video.muted = val;
|
|
411
|
+
}
|
|
460
412
|
}, {
|
|
461
|
-
key:
|
|
413
|
+
key: "volume",
|
|
414
|
+
get: function get() {
|
|
415
|
+
return this.video.volume;
|
|
416
|
+
},
|
|
417
|
+
set: function set(val) {
|
|
418
|
+
this.video.volume = val;
|
|
419
|
+
}
|
|
462
420
|
|
|
421
|
+
// video width
|
|
422
|
+
}, {
|
|
423
|
+
key: "videoWidth",
|
|
424
|
+
get: function get() {
|
|
425
|
+
return this.video.videoWidth;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// video height
|
|
429
|
+
}, {
|
|
430
|
+
key: "videoHeight",
|
|
431
|
+
get: function get() {
|
|
432
|
+
return this.video.videoHeight;
|
|
433
|
+
}
|
|
463
434
|
|
|
464
435
|
// play the video
|
|
436
|
+
}, {
|
|
437
|
+
key: "play",
|
|
465
438
|
value: function play() {
|
|
466
439
|
this.video.play();
|
|
467
440
|
}
|
|
468
441
|
|
|
469
442
|
// pause the video
|
|
470
|
-
|
|
471
443
|
}, {
|
|
472
|
-
key:
|
|
444
|
+
key: "pause",
|
|
473
445
|
value: function pause() {
|
|
474
446
|
this.video.pause();
|
|
475
447
|
}
|
|
476
448
|
|
|
477
449
|
// Change the video source and re-load the video:
|
|
478
|
-
|
|
479
450
|
}, {
|
|
480
|
-
key:
|
|
451
|
+
key: "load",
|
|
481
452
|
value: function load() {
|
|
482
453
|
this.video.load();
|
|
483
454
|
}
|
|
484
455
|
|
|
485
456
|
// Add a new text track to the video
|
|
486
|
-
|
|
487
457
|
}, {
|
|
488
|
-
key:
|
|
458
|
+
key: "addTextTrack",
|
|
489
459
|
value: function addTextTrack() {
|
|
490
|
-
var
|
|
491
|
-
|
|
492
|
-
(_video = this.video).addTextTrack.apply(_video, arguments);
|
|
460
|
+
var _this$video;
|
|
461
|
+
(_this$video = this.video).addTextTrack.apply(_this$video, arguments);
|
|
493
462
|
}
|
|
494
463
|
|
|
495
464
|
// Check if your browser can play different types of video:
|
|
496
|
-
|
|
497
465
|
}, {
|
|
498
|
-
key:
|
|
466
|
+
key: "canPlayType",
|
|
499
467
|
value: function canPlayType() {
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
(_video2 = this.video).canPlayType.apply(_video2, arguments);
|
|
468
|
+
var _this$video2;
|
|
469
|
+
(_this$video2 = this.video).canPlayType.apply(_this$video2, arguments);
|
|
503
470
|
}
|
|
504
471
|
|
|
505
472
|
// seek video by time
|
|
506
|
-
|
|
507
473
|
}, {
|
|
508
|
-
key:
|
|
474
|
+
key: "seek",
|
|
509
475
|
value: function seek(time) {
|
|
510
476
|
this.video.seek(time);
|
|
511
477
|
}
|
|
512
478
|
|
|
513
479
|
// jump forward x seconds
|
|
514
|
-
|
|
515
480
|
}, {
|
|
516
|
-
key:
|
|
481
|
+
key: "forward",
|
|
517
482
|
value: function forward(seconds) {
|
|
518
483
|
this.video.forward(seconds);
|
|
519
484
|
}
|
|
520
485
|
|
|
521
486
|
// jump back x seconds
|
|
522
|
-
|
|
523
487
|
}, {
|
|
524
|
-
key:
|
|
488
|
+
key: "replay",
|
|
525
489
|
value: function replay(seconds) {
|
|
526
490
|
this.video.replay(seconds);
|
|
527
491
|
}
|
|
528
492
|
|
|
529
493
|
// enter or exist full screen
|
|
530
|
-
|
|
531
494
|
}, {
|
|
532
|
-
key:
|
|
495
|
+
key: "toggleFullscreen",
|
|
533
496
|
value: function toggleFullscreen() {
|
|
534
497
|
this.video.toggleFullscreen();
|
|
535
498
|
}
|
|
536
499
|
|
|
537
500
|
// subscribe to player state change
|
|
538
|
-
|
|
539
501
|
}, {
|
|
540
|
-
key:
|
|
502
|
+
key: "subscribeToStateChange",
|
|
541
503
|
value: function subscribeToStateChange(listener) {
|
|
542
504
|
return this.manager.subscribeToPlayerStateChange(listener);
|
|
543
505
|
}
|
|
544
506
|
|
|
545
507
|
// player resize
|
|
546
|
-
|
|
547
508
|
}, {
|
|
548
|
-
key:
|
|
509
|
+
key: "handleResize",
|
|
549
510
|
value: function handleResize() {
|
|
550
|
-
var
|
|
551
|
-
|
|
552
|
-
|
|
511
|
+
var _this$manager$getStat = this.manager.getState(),
|
|
512
|
+
player = _this$manager$getStat.player;
|
|
553
513
|
var leftSectionRef = this._leftSectionRef;
|
|
554
514
|
var rightSectionRef = this._rightSectionRef;
|
|
555
515
|
var audioMeterBlock = this._audioMeterBlock;
|
|
@@ -559,13 +519,12 @@ var Player = function (_Component) {
|
|
|
559
519
|
var controlBar = (0, _reactDom.findDOMNode)(this._controlBar);
|
|
560
520
|
var playlist = (0, _reactDom.findDOMNode)(this._playlist);
|
|
561
521
|
var playerContainer = (0, _reactDom.findDOMNode)(this._playerContainer);
|
|
562
|
-
var
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
522
|
+
var _this$props = this.props,
|
|
523
|
+
controlType = _this$props.controlType,
|
|
524
|
+
playerType = _this$props.playerType,
|
|
525
|
+
fileType = _this$props.fileType;
|
|
567
526
|
var height = 0;
|
|
568
|
-
|
|
527
|
+
_toConsumableArray(leftSectionRef.children).forEach(function (child) {
|
|
569
528
|
return height += child.offsetHeight;
|
|
570
529
|
});
|
|
571
530
|
if (rightSectionRef) {
|
|
@@ -637,15 +596,15 @@ var Player = function (_Component) {
|
|
|
637
596
|
video.style.margin = '0 auto';
|
|
638
597
|
video.classList.add('ratio-border');
|
|
639
598
|
}
|
|
640
|
-
// this.video.handleResize();
|
|
599
|
+
// this.video.handleResize();
|
|
641
600
|
}
|
|
642
601
|
}, {
|
|
643
|
-
key:
|
|
602
|
+
key: "handleFullScreenChange",
|
|
644
603
|
value: function handleFullScreenChange() {
|
|
645
|
-
this.actions.handleFullscreenChange(
|
|
604
|
+
this.actions.handleFullscreenChange(_fullscreen["default"].isFullscreen);
|
|
646
605
|
}
|
|
647
606
|
}, {
|
|
648
|
-
key:
|
|
607
|
+
key: "handleStateChange",
|
|
649
608
|
value: function handleStateChange(state, prevState) {
|
|
650
609
|
if (state.isFullscreen !== prevState.isFullscreen) {
|
|
651
610
|
this.handleResize();
|
|
@@ -653,24 +612,22 @@ var Player = function (_Component) {
|
|
|
653
612
|
this.forceUpdate(); // re-render
|
|
654
613
|
}
|
|
655
614
|
}, {
|
|
656
|
-
key:
|
|
615
|
+
key: "handleFocus",
|
|
657
616
|
value: function handleFocus() {
|
|
658
617
|
this.actions.activate(true);
|
|
659
618
|
}
|
|
660
619
|
}, {
|
|
661
|
-
key:
|
|
620
|
+
key: "handleBlur",
|
|
662
621
|
value: function handleBlur() {
|
|
663
622
|
this.actions.activate(false);
|
|
664
623
|
}
|
|
665
624
|
}, {
|
|
666
|
-
key:
|
|
625
|
+
key: "render",
|
|
667
626
|
value: function render() {
|
|
668
627
|
var _this5 = this;
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
var props = _extends({}, this.props, {
|
|
628
|
+
var _this$manager$getStat2 = this.manager.getState(),
|
|
629
|
+
player = _this$manager$getStat2.player;
|
|
630
|
+
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
674
631
|
player: player,
|
|
675
632
|
actions: this.actions,
|
|
676
633
|
manager: this.manager,
|
|
@@ -678,144 +635,69 @@ var Player = function (_Component) {
|
|
|
678
635
|
video: this.video ? this.video.video : null
|
|
679
636
|
});
|
|
680
637
|
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'
|
|
638
|
+
var _this$props2 = this.props,
|
|
639
|
+
rightSection = _this$props2.rightSection,
|
|
640
|
+
playerType = _this$props2.playerType;
|
|
641
|
+
return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
|
|
642
|
+
ref: function ref(c) {
|
|
643
|
+
_this5.manager.rootElement = c;
|
|
696
644
|
},
|
|
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;
|
|
645
|
+
role: "region",
|
|
646
|
+
onFocus: this.handleFocus,
|
|
647
|
+
onBlur: this.handleBlur,
|
|
648
|
+
tabIndex: "-1"
|
|
649
|
+
}, /*#__PURE__*/_react["default"].createElement(PlayerContainer, _extends({
|
|
650
|
+
ref: function ref(playerContainer) {
|
|
651
|
+
_this5._playerContainer = playerContainer;
|
|
652
|
+
}
|
|
653
|
+
}, props, {
|
|
654
|
+
hasRightSection: !!rightSection
|
|
655
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
656
|
+
className: "left-video-section",
|
|
657
|
+
ref: function ref(leftSectionRef) {
|
|
658
|
+
_this5._leftSectionRef = leftSectionRef;
|
|
659
|
+
}
|
|
660
|
+
}, childrensLeft), /*#__PURE__*/_react["default"].createElement("div", {
|
|
661
|
+
className: "audio-meter-block ".concat(playerType),
|
|
662
|
+
ref: function ref(audioMeterBlock) {
|
|
663
|
+
_this5._audioMeterBlock = audioMeterBlock;
|
|
664
|
+
}
|
|
665
|
+
}, /*#__PURE__*/_react["default"].createElement(AudioMeterBlock, {
|
|
666
|
+
onClick: function onClick() {
|
|
667
|
+
_this5.meterBlockClick();
|
|
668
|
+
},
|
|
669
|
+
role: "presentation",
|
|
670
|
+
active: true
|
|
671
|
+
}, /*#__PURE__*/_react["default"].createElement(_AudioMeter["default"], {
|
|
672
|
+
player: props.player,
|
|
673
|
+
height: this.meterHeight
|
|
674
|
+
}))), rightSection ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
675
|
+
className: "right-video-section",
|
|
676
|
+
ref: function ref(rightSectionRef) {
|
|
677
|
+
_this5._rightSectionRef = rightSectionRef;
|
|
678
|
+
}
|
|
679
|
+
}, rightSection) : null), props.controlType === 'advanced' ? /*#__PURE__*/_react["default"].createElement(ControlContainer, {
|
|
680
|
+
ref: function ref(advancedControl) {
|
|
681
|
+
_this5._advancedControl = advancedControl;
|
|
682
|
+
}
|
|
683
|
+
}, /*#__PURE__*/_react["default"].createElement(_ProgressControl["default"], _extends({}, props, {
|
|
684
|
+
key: "progress-control",
|
|
685
|
+
order: 1
|
|
686
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_Playlist["default"], _extends({
|
|
687
|
+
ref: function ref(c) {
|
|
688
|
+
_this5._playlist = c;
|
|
689
|
+
},
|
|
690
|
+
key: "playlist",
|
|
691
|
+
order: 5
|
|
692
|
+
}, this.props)));
|
|
809
693
|
}
|
|
810
694
|
}]);
|
|
811
|
-
|
|
812
695
|
return Player;
|
|
813
696
|
}(_react.Component);
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
Player.contextTypes = { store: _propTypes.PropTypes.instanceOf(Object) };
|
|
697
|
+
exports["default"] = Player;
|
|
698
|
+
Player.contextTypes = {
|
|
699
|
+
store: _propTypes.PropTypes.instanceOf(Object)
|
|
700
|
+
};
|
|
819
701
|
Player.propTypes = propTypes;
|
|
820
702
|
Player.defaultProps = defaultProps;
|
|
821
703
|
Player.displayName = 'Player';
|