@desynova-digital/player 4.0.0 → 4.0.2
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 +99 -0
- package/actions/player.js +331 -0
- package/actions/video.js +206 -0
- package/{utils/colors.js → colors.js} +1 -2
- package/{media → components}/AudioMeter.js +96 -109
- package/components/BigPlayButton.js +84 -0
- package/components/ImageViewer.js +272 -0
- package/{control → components}/MarkerBar.js +33 -24
- package/{utils → components}/Menu.js +13 -4
- package/components/Player.js +706 -0
- package/{header/Header.js → components/PlayerHeader.js} +104 -78
- package/components/Playlist.js +95 -0
- package/{control → components}/PointersBar.js +122 -61
- package/components/PosterImage.js +50 -0
- package/{media → components}/SDOutline.js +13 -49
- package/components/Shortcut.js +821 -0
- package/{control → components}/Slider.js +27 -23
- package/components/TagsBar.js +81 -0
- package/components/Video.js +1280 -0
- package/{control → components/control-bar}/AudioTracksMenuButton.js +32 -28
- package/components/control-bar/CameraButton.js +75 -0
- package/components/control-bar/CommentsButton.js +186 -0
- package/components/control-bar/ControlBar.js +266 -0
- package/components/control-bar/EditorControlMenuButton.js +317 -0
- package/components/control-bar/ForwardControl.js +12 -0
- package/components/control-bar/ForwardReplayControl.js +106 -0
- package/{control → components/control-bar}/FullscreenToggle.js +26 -21
- package/components/control-bar/PlayToggle.js +85 -0
- package/components/control-bar/ReplayControl.js +12 -0
- package/components/control-bar/SettingsMenuButton.js +41 -0
- package/components/control-bar/SubtitleLanguagesMenuButton.js +149 -0
- package/components/control-bar/SubtitleMovementMenu.js +140 -0
- package/{control/VolumneMenuButton.js → components/control-bar/VolumeMenuButton.js} +26 -27
- package/components/control-bar/ZoomMenuButton.js +90 -0
- package/{control → components/marking-controls}/MarkInControl.js +32 -25
- package/{control → components/marking-controls}/MarkOutControl.js +35 -26
- package/components/marking-controls/MarkingAddButton.js +79 -0
- package/components/marking-controls/MarkingControl.js +95 -0
- package/components/marking-controls/MarkingDeleteButton.js +70 -0
- package/{control → components/marking-controls}/MarkingDuration.js +12 -5
- package/components/marking-controls/MarkingPreview.js +72 -0
- package/components/progress-bar/AudioWaveform.js +126 -0
- package/components/progress-bar/LoadProgressBar.js +67 -0
- package/components/progress-bar/MouseTimeDisplay.js +36 -0
- package/{control → components/progress-bar}/PlayProgressBar.js +4 -4
- package/components/progress-bar/ProgressControl.js +186 -0
- package/{control → components/progress-bar}/SeekBar.js +113 -72
- package/{control → components/progress-bar}/Timeline.js +43 -32
- package/{control/PlayBackRateControl.js → components/settings-menu-control/PlaybackRateControl.js} +44 -30
- package/components/settings-menu-control/SafeAreaControl.js +81 -0
- package/components/settings-menu-control/SettingsMenu.js +56 -0
- package/components/settings-menu-control/SubtitleControl.js +1 -0
- package/components/time-controls/CurrentTimeDisplay.js +83 -0
- package/{control → components/time-controls}/DurationDisplay.js +8 -15
- package/components/time-controls/TimeDivider.js +25 -0
- package/{control → components/volume-control}/VolumeBar.js +62 -80
- package/components/volume-control/VolumeControl.js +19 -0
- package/{control → components/volume-control}/VolumeLevel.js +2 -3
- package/components/zoom-control/ZoomBar.js +155 -0
- package/components/zoom-control/ZoomLevel.js +55 -0
- package/index.js +198 -1
- package/package.json +5 -8
- package/reducers/index.js +19 -0
- package/reducers/operation.js +35 -0
- package/reducers/player.js +222 -0
- package/utils/browser.js +30 -0
- package/utils/dom.js +93 -0
- package/utils/fullscreen.js +72 -0
- package/utils/index.js +156 -57
- package/Player.js +0 -945
- package/control/AudioTracksMenuButton.jsx +0 -80
- package/control/ControlBar.js +0 -303
- package/control/ControlBar.jsx +0 -264
- package/control/CurrentTimeDisplay.js +0 -34
- package/control/CurrentTimeDisplay.jsx +0 -35
- package/control/DurationDisplay.jsx +0 -48
- package/control/ForwardBackwardControl.js +0 -76
- package/control/ForwardBackwardControl.jsx +0 -79
- package/control/FullscreenToggle.jsx +0 -83
- package/control/MarkInControl.jsx +0 -109
- package/control/MarkOutControl.jsx +0 -131
- package/control/MarkerBar.jsx +0 -107
- package/control/MarkingControl.js +0 -82
- package/control/MarkingControl.jsx +0 -143
- package/control/MarkingPreview.js +0 -49
- package/control/MarkingPreview.jsx +0 -60
- package/control/PlayBackRateControl.jsx +0 -106
- package/control/PlayProgressBar.jsx +0 -92
- package/control/PlayToggle.js +0 -56
- package/control/PlayToggle.jsx +0 -57
- package/control/PointersBar.jsx +0 -286
- package/control/ProgressControl.js +0 -127
- package/control/ProgressControl.jsx +0 -155
- package/control/SeekBar.jsx +0 -229
- package/control/SettingsMenuButton.js +0 -63
- package/control/SettingsMenuButton.jsx +0 -69
- package/control/Slider.jsx +0 -243
- package/control/Timeline.jsx +0 -131
- package/control/VolumeBar.jsx +0 -174
- package/control/VolumeLevel.jsx +0 -66
- package/control/VolumneMenuButton.jsx +0 -111
- package/header/Header.jsx +0 -479
- package/media/AudioMeter.jsx +0 -411
- package/media/SDOutline.jsx +0 -90
- package/media/Video.js +0 -684
- package/media/Video.jsx +0 -714
- package/playlist/Playlist.js +0 -67
- package/playlist/Playlist.jsx +0 -91
- package/playlist/index.js +0 -13
- package/shortcuts/Shortcut.js +0 -662
- package/utils/Menu.jsx +0 -105
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
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(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
26
|
+
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; }
|
|
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(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; }
|
|
34
|
+
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; }
|
|
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); }
|
|
37
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
41
|
+
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); }
|
|
42
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
43
|
+
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); }
|
|
44
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
45
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
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 _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); }
|
|
48
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
50
|
+
var propTypes = {
|
|
51
|
+
store: _propTypes.PropTypes.instanceOf(Object),
|
|
52
|
+
width: _propTypes.PropTypes.oneOfType([_propTypes.PropTypes.string, _propTypes.PropTypes.number]),
|
|
53
|
+
height: _propTypes.PropTypes.oneOfType([_propTypes.PropTypes.string, _propTypes.PropTypes.number]),
|
|
54
|
+
frameRate: _propTypes.PropTypes.number,
|
|
55
|
+
initialTime: _propTypes.PropTypes.number,
|
|
56
|
+
audioSrc: _propTypes.PropTypes.string,
|
|
57
|
+
fluid: _propTypes.PropTypes.bool,
|
|
58
|
+
muted: _propTypes.PropTypes.bool,
|
|
59
|
+
playsInline: _propTypes.PropTypes.bool,
|
|
60
|
+
aspectRatio: _propTypes.PropTypes.string,
|
|
61
|
+
videoId: _propTypes.PropTypes.string,
|
|
62
|
+
startTime: _propTypes.PropTypes.number,
|
|
63
|
+
loop: _propTypes.PropTypes.bool,
|
|
64
|
+
autoPlay: _propTypes.PropTypes.bool,
|
|
65
|
+
src: _propTypes.PropTypes.string,
|
|
66
|
+
poster: _propTypes.PropTypes.string,
|
|
67
|
+
preload: _propTypes.PropTypes.oneOf(['auto', 'metadata', 'none']),
|
|
68
|
+
videoDetails: _propTypes.PropTypes.instanceOf(Object),
|
|
69
|
+
rightSection: _propTypes.PropTypes.node,
|
|
70
|
+
onPlayerClose: _propTypes.PropTypes.func,
|
|
71
|
+
onCommentsAdd: _propTypes.PropTypes.func,
|
|
72
|
+
onLoadStart: _propTypes.PropTypes.func,
|
|
73
|
+
onWaiting: _propTypes.PropTypes.func,
|
|
74
|
+
onCanPlay: _propTypes.PropTypes.func,
|
|
75
|
+
onCanPlayThrough: _propTypes.PropTypes.func,
|
|
76
|
+
onPlaying: _propTypes.PropTypes.func,
|
|
77
|
+
onEnded: _propTypes.PropTypes.func,
|
|
78
|
+
onSeeking: _propTypes.PropTypes.func,
|
|
79
|
+
onSeeked: _propTypes.PropTypes.func,
|
|
80
|
+
onPlay: _propTypes.PropTypes.func,
|
|
81
|
+
onPause: _propTypes.PropTypes.func,
|
|
82
|
+
onProgress: _propTypes.PropTypes.func,
|
|
83
|
+
onDurationChange: _propTypes.PropTypes.func,
|
|
84
|
+
onError: _propTypes.PropTypes.func,
|
|
85
|
+
onSuspend: _propTypes.PropTypes.func,
|
|
86
|
+
onAbort: _propTypes.PropTypes.func,
|
|
87
|
+
onEmptied: _propTypes.PropTypes.func,
|
|
88
|
+
onStalled: _propTypes.PropTypes.func,
|
|
89
|
+
onLoadedMetadata: _propTypes.PropTypes.func,
|
|
90
|
+
onLoadedData: _propTypes.PropTypes.func,
|
|
91
|
+
onTimeUpdate: _propTypes.PropTypes.func,
|
|
92
|
+
onRateChange: _propTypes.PropTypes.func,
|
|
93
|
+
onVolumeChange: _propTypes.PropTypes.func,
|
|
94
|
+
onAddMarker: _propTypes.PropTypes.func,
|
|
95
|
+
onMarkerSelect: _propTypes.PropTypes.func,
|
|
96
|
+
onTagClick: _propTypes.PropTypes.func,
|
|
97
|
+
onDeleteMarker: _propTypes.PropTypes.func,
|
|
98
|
+
onEditAction: _propTypes.PropTypes.func,
|
|
99
|
+
onPlayerChange: _propTypes.PropTypes.func,
|
|
100
|
+
fileType: _propTypes.PropTypes.oneOf(['video', 'image', 'audio']),
|
|
101
|
+
playerType: _propTypes.PropTypes.oneOf(['dubbing_review', 'clipping_default', 'default', 'tagging', 'qc', 'subtitle', 'snp_edit', 'archive', 'restore', 'clipping', 'storyboard', 'panel']),
|
|
102
|
+
assetType: _propTypes.PropTypes.oneOf(['fc', 'rc']),
|
|
103
|
+
controlType: _propTypes.PropTypes.oneOf(['default', 'advanced']),
|
|
104
|
+
markers: _propTypes.PropTypes.instanceOf(Array),
|
|
105
|
+
playlist: _propTypes.PropTypes.instanceOf(Array),
|
|
106
|
+
playlistClick: _propTypes.PropTypes.func,
|
|
107
|
+
transcriptArr: _propTypes.PropTypes.instanceOf(Array),
|
|
108
|
+
tagsMarker: _propTypes.PropTypes.instanceOf(Array),
|
|
109
|
+
theme: _propTypes.PropTypes.string
|
|
110
|
+
};
|
|
111
|
+
var defaultProps = {
|
|
112
|
+
fluid: true,
|
|
113
|
+
muted: false,
|
|
114
|
+
playsInline: false,
|
|
115
|
+
aspectRatio: 'auto',
|
|
116
|
+
playerType: 'default',
|
|
117
|
+
controlType: 'default',
|
|
118
|
+
width: null,
|
|
119
|
+
height: null,
|
|
120
|
+
frameRate: 25,
|
|
121
|
+
initialTime: 35990,
|
|
122
|
+
audioSrc: '',
|
|
123
|
+
videoId: '',
|
|
124
|
+
startTime: 0,
|
|
125
|
+
loop: false,
|
|
126
|
+
autoPlay: false,
|
|
127
|
+
src: '',
|
|
128
|
+
poster: '',
|
|
129
|
+
preload: 'auto',
|
|
130
|
+
videoDetails: {
|
|
131
|
+
title: 'Opposition making fuss about Rupee weakening'
|
|
132
|
+
},
|
|
133
|
+
assetType: 'fc',
|
|
134
|
+
onPlayerClose: null,
|
|
135
|
+
onLoadStart: null,
|
|
136
|
+
onWaiting: null,
|
|
137
|
+
onCanPlay: null,
|
|
138
|
+
onCanPlayThrough: null,
|
|
139
|
+
onPlaying: null,
|
|
140
|
+
onEnded: null,
|
|
141
|
+
onSeeking: null,
|
|
142
|
+
onSeeked: null,
|
|
143
|
+
onPlay: null,
|
|
144
|
+
onPause: null,
|
|
145
|
+
onProgress: null,
|
|
146
|
+
onDurationChange: null,
|
|
147
|
+
onError: null,
|
|
148
|
+
onSuspend: null,
|
|
149
|
+
onAbort: null,
|
|
150
|
+
onEmptied: null,
|
|
151
|
+
onStalled: null,
|
|
152
|
+
onLoadedMetadata: null,
|
|
153
|
+
onLoadedData: null,
|
|
154
|
+
onTimeUpdate: null,
|
|
155
|
+
onRateChange: null,
|
|
156
|
+
onVolumeChange: null
|
|
157
|
+
};
|
|
158
|
+
var PlayerBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n"])));
|
|
159
|
+
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) {
|
|
160
|
+
if (props.hasRightSection) {
|
|
161
|
+
return '63.67%';
|
|
162
|
+
} else {
|
|
163
|
+
return '100%';
|
|
164
|
+
}
|
|
165
|
+
}, function (props) {
|
|
166
|
+
if (props.playerType === 'qc') {
|
|
167
|
+
return 'calc(36.33% - 70px)';
|
|
168
|
+
} else {
|
|
169
|
+
return '36.33%';
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
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) {
|
|
173
|
+
return !props.active ? '50px' : '55px';
|
|
174
|
+
}, function (props) {
|
|
175
|
+
return !props.active ? '50px !important' : 'calc(100% - 40px)';
|
|
176
|
+
}, function (props) {
|
|
177
|
+
return !props.active ? '5px' : '0px';
|
|
178
|
+
}, function (props) {
|
|
179
|
+
return !props.active ? '5px' : '0px';
|
|
180
|
+
}, function (props) {
|
|
181
|
+
return !props.active ? '5px' : '0px';
|
|
182
|
+
}, function (props) {
|
|
183
|
+
return !props.active ? 'rgba(243, 243, 243, 0.5)' : 'rgba(0, 0, 0, 1)';
|
|
184
|
+
}, function (props) {
|
|
185
|
+
return !props.active ? '5px' : '0px';
|
|
186
|
+
}, function (props) {
|
|
187
|
+
return !props.active ? 'block' : 'inline-block';
|
|
188
|
+
}, function (props) {
|
|
189
|
+
return !props.active ? '0' : '20px 0';
|
|
190
|
+
});
|
|
191
|
+
var ControlContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral([""])));
|
|
192
|
+
var Player = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
193
|
+
_inherits(Player, _Component);
|
|
194
|
+
function Player(props) {
|
|
195
|
+
var _this;
|
|
196
|
+
_classCallCheck(this, Player);
|
|
197
|
+
_this = _callSuper(this, Player, [props]);
|
|
198
|
+
_this.controlsHideTimer = null;
|
|
199
|
+
_this.meterHeight = 40;
|
|
200
|
+
_this.video = null; // the Video component
|
|
201
|
+
_this.manager = new _Manager["default"](props.store);
|
|
202
|
+
_this.actions = _this.manager.getActions();
|
|
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));
|
|
209
|
+
_this.actions.handlePlayerType(props.playerType);
|
|
210
|
+
_this.actions.handleControlType(props.controlType);
|
|
211
|
+
return _this;
|
|
212
|
+
}
|
|
213
|
+
_createClass(Player, [{
|
|
214
|
+
key: "componentDidMount",
|
|
215
|
+
value: function componentDidMount() {
|
|
216
|
+
this.handleResize();
|
|
217
|
+
window.addEventListener('resize', this.handleResize);
|
|
218
|
+
_fullscreen["default"].addEventListener(this.handleFullScreenChange);
|
|
219
|
+
/*
|
|
220
|
+
* const { player } = this.manager.getState();
|
|
221
|
+
* this.actions.toggleFullscreen(player);
|
|
222
|
+
*/
|
|
223
|
+
}
|
|
224
|
+
}, {
|
|
225
|
+
key: "componentDidUpdate",
|
|
226
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
227
|
+
var playerType = this.props.playerType;
|
|
228
|
+
this.handleResize();
|
|
229
|
+
if (playerType !== prevProps.playerType) {
|
|
230
|
+
this.actions.handleZoomChange(0);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}, {
|
|
234
|
+
key: "componentWillUnmount",
|
|
235
|
+
value: function componentWillUnmount() {
|
|
236
|
+
// Remove event listener
|
|
237
|
+
window.removeEventListener('resize', this.handleResize);
|
|
238
|
+
_fullscreen["default"].removeEventListener(this.handleFullScreenChange);
|
|
239
|
+
if (this.controlsHideTimer) {
|
|
240
|
+
window.clearTimeout(this.controlsHideTimer);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}, {
|
|
244
|
+
key: "onTagsReset",
|
|
245
|
+
value: function onTagsReset() {
|
|
246
|
+
this.actions.handleVideoPreview(false);
|
|
247
|
+
this.actions.handleMarkerPointChange('delete');
|
|
248
|
+
}
|
|
249
|
+
}, {
|
|
250
|
+
key: "onSegmentClick",
|
|
251
|
+
value: function onSegmentClick(start_time, end_time, seek) {
|
|
252
|
+
this.actions.handleMarkerUpdate(start_time, end_time);
|
|
253
|
+
seek ? this.actions.pause() : this.actions.play();
|
|
254
|
+
this.actions.handleVideoRewind(false);
|
|
255
|
+
this.actions.seek(start_time);
|
|
256
|
+
this.actions.handleVideoPreview(true);
|
|
257
|
+
}
|
|
258
|
+
}, {
|
|
259
|
+
key: "getDefaultChildren",
|
|
260
|
+
value: function getDefaultChildren(props, fullProps) {
|
|
261
|
+
var _this2 = this;
|
|
262
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
263
|
+
ref: function ref(c) {
|
|
264
|
+
_this2._playerHeader = c;
|
|
265
|
+
},
|
|
266
|
+
key: "video-header",
|
|
267
|
+
order: 1
|
|
268
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_Video["default"], _extends({
|
|
269
|
+
ref: function ref(c) {
|
|
270
|
+
_this2.video = c;
|
|
271
|
+
_this2.manager.video = _this2.video;
|
|
272
|
+
},
|
|
273
|
+
key: "video",
|
|
274
|
+
order: 2
|
|
275
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ProgressControl["default"], _extends({
|
|
276
|
+
ref: function ref(c) {
|
|
277
|
+
_this2._progressControl = c;
|
|
278
|
+
}
|
|
279
|
+
}, this.props, {
|
|
280
|
+
key: "progress-control",
|
|
281
|
+
order: 3
|
|
282
|
+
})), /*#__PURE__*/_react["default"].createElement(_ControlBar["default"], _extends({
|
|
283
|
+
ref: function ref(c) {
|
|
284
|
+
_this2._controlBar = c;
|
|
285
|
+
},
|
|
286
|
+
key: "control-bar",
|
|
287
|
+
order: 4
|
|
288
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
|
|
289
|
+
key: "shortcut",
|
|
290
|
+
order: 99.0
|
|
291
|
+
}, props, {
|
|
292
|
+
frameRate: fullProps.frameRate
|
|
293
|
+
}))];
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
key: "getImageChildren",
|
|
297
|
+
value: function getImageChildren(props, fullProps) {
|
|
298
|
+
var _this3 = this;
|
|
299
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
300
|
+
ref: function ref(c) {
|
|
301
|
+
_this3._playerHeader = c;
|
|
302
|
+
},
|
|
303
|
+
key: "video-header",
|
|
304
|
+
order: 1
|
|
305
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ImageViewer["default"], _extends({
|
|
306
|
+
ref: function ref(c) {
|
|
307
|
+
_this3.video = c;
|
|
308
|
+
_this3.manager.video = _this3.video;
|
|
309
|
+
},
|
|
310
|
+
key: "image",
|
|
311
|
+
order: 0.0
|
|
312
|
+
}, fullProps)),
|
|
313
|
+
/*#__PURE__*/
|
|
314
|
+
/*
|
|
315
|
+
* <ControlBar
|
|
316
|
+
* ref={(c) => {
|
|
317
|
+
* this._controlBar = c;
|
|
318
|
+
* }}
|
|
319
|
+
* key="control-bar"
|
|
320
|
+
* order={2}
|
|
321
|
+
* {...this.props}
|
|
322
|
+
* />,
|
|
323
|
+
*/
|
|
324
|
+
_react["default"].createElement(_Shortcut["default"], _extends({
|
|
325
|
+
key: "shortcut",
|
|
326
|
+
order: 99.0
|
|
327
|
+
}, props))];
|
|
328
|
+
}
|
|
329
|
+
}, {
|
|
330
|
+
key: "getAdvancedChildren",
|
|
331
|
+
value: function getAdvancedChildren(props, fullProps) {
|
|
332
|
+
var _this4 = this;
|
|
333
|
+
return [/*#__PURE__*/_react["default"].createElement(_PlayerHeader["default"], _extends({
|
|
334
|
+
ref: function ref(c) {
|
|
335
|
+
_this4._playerHeader = c;
|
|
336
|
+
},
|
|
337
|
+
key: "video-header",
|
|
338
|
+
order: 1
|
|
339
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_Video["default"], _extends({
|
|
340
|
+
ref: function ref(c) {
|
|
341
|
+
_this4.video = c;
|
|
342
|
+
_this4.manager.video = _this4.video;
|
|
343
|
+
},
|
|
344
|
+
key: "video",
|
|
345
|
+
order: 0.0
|
|
346
|
+
}, fullProps)), /*#__PURE__*/_react["default"].createElement(_ControlBar["default"], _extends({
|
|
347
|
+
ref: function ref(c) {
|
|
348
|
+
_this4._controlBar = c;
|
|
349
|
+
},
|
|
350
|
+
key: "control-bar",
|
|
351
|
+
order: 2
|
|
352
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_Shortcut["default"], _extends({
|
|
353
|
+
key: "shortcut",
|
|
354
|
+
order: 99.0
|
|
355
|
+
}, props, {
|
|
356
|
+
frameRate: fullProps.frameRate
|
|
357
|
+
}))];
|
|
358
|
+
}
|
|
359
|
+
}, {
|
|
360
|
+
key: "getChildren",
|
|
361
|
+
value: function getChildren(props, position) {
|
|
362
|
+
if (position === 'left') {
|
|
363
|
+
var _propsWithoutChildren = _objectSpread(_objectSpread({}, props), {}, {
|
|
364
|
+
children: null
|
|
365
|
+
});
|
|
366
|
+
var _children = [];
|
|
367
|
+
var _defaultChildren = [];
|
|
368
|
+
switch (props.fileType) {
|
|
369
|
+
case 'image':
|
|
370
|
+
_defaultChildren = this.getImageChildren();
|
|
371
|
+
break;
|
|
372
|
+
default:
|
|
373
|
+
_defaultChildren = props.controlType === 'advanced' && !props.player.isFullscreen ? this.getAdvancedChildren(_propsWithoutChildren, props) : this.getDefaultChildren(_propsWithoutChildren, props);
|
|
374
|
+
}
|
|
375
|
+
return (0, _utils.mergeAndSortChildren)(_defaultChildren, _children, _propsWithoutChildren);
|
|
376
|
+
}
|
|
377
|
+
var propsWithoutChildren = _objectSpread(_objectSpread({}, props), {}, {
|
|
378
|
+
children: null
|
|
379
|
+
});
|
|
380
|
+
var children = [];
|
|
381
|
+
var defaultChildren = props.controlType === 'advanced' ? this.getAdvancedChildren(propsWithoutChildren, props) : this.getDefaultChildren(propsWithoutChildren, props);
|
|
382
|
+
return (0, _utils.mergeAndSortChildren)(defaultChildren, children, propsWithoutChildren);
|
|
383
|
+
}
|
|
384
|
+
/*
|
|
385
|
+
* get redux state
|
|
386
|
+
* { player, operation }
|
|
387
|
+
*/
|
|
388
|
+
}, {
|
|
389
|
+
key: "getState",
|
|
390
|
+
value: function getState() {
|
|
391
|
+
return this.manager.getState();
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// get playback rate
|
|
395
|
+
}, {
|
|
396
|
+
key: "playbackRate",
|
|
397
|
+
get: function get() {
|
|
398
|
+
return this.video.playbackRate;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/*
|
|
402
|
+
* set playback rate
|
|
403
|
+
* speed of video
|
|
404
|
+
*/,
|
|
405
|
+
set: function set(rate) {
|
|
406
|
+
this.video.playbackRate = rate;
|
|
407
|
+
}
|
|
408
|
+
}, {
|
|
409
|
+
key: "muted",
|
|
410
|
+
get: function get() {
|
|
411
|
+
return this.video.muted;
|
|
412
|
+
},
|
|
413
|
+
set: function set(val) {
|
|
414
|
+
this.video.muted = val;
|
|
415
|
+
}
|
|
416
|
+
}, {
|
|
417
|
+
key: "volume",
|
|
418
|
+
get: function get() {
|
|
419
|
+
return this.video.volume;
|
|
420
|
+
},
|
|
421
|
+
set: function set(val) {
|
|
422
|
+
this.video.volume = val;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// video width
|
|
426
|
+
}, {
|
|
427
|
+
key: "videoWidth",
|
|
428
|
+
get: function get() {
|
|
429
|
+
return this.video.videoWidth;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// video height
|
|
433
|
+
}, {
|
|
434
|
+
key: "videoHeight",
|
|
435
|
+
get: function get() {
|
|
436
|
+
return this.video.videoHeight;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// play the video
|
|
440
|
+
}, {
|
|
441
|
+
key: "play",
|
|
442
|
+
value: function play() {
|
|
443
|
+
this.video.play();
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// pause the video
|
|
447
|
+
}, {
|
|
448
|
+
key: "pause",
|
|
449
|
+
value: function pause() {
|
|
450
|
+
this.video.pause();
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// Change the video source and re-load the video:
|
|
454
|
+
}, {
|
|
455
|
+
key: "load",
|
|
456
|
+
value: function load() {
|
|
457
|
+
this.video.load();
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// Add a new text track to the video
|
|
461
|
+
}, {
|
|
462
|
+
key: "addTextTrack",
|
|
463
|
+
value: function addTextTrack() {
|
|
464
|
+
var _this$video;
|
|
465
|
+
(_this$video = this.video).addTextTrack.apply(_this$video, arguments);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// Check if your browser can play different types of video:
|
|
469
|
+
}, {
|
|
470
|
+
key: "canPlayType",
|
|
471
|
+
value: function canPlayType() {
|
|
472
|
+
var _this$video2;
|
|
473
|
+
(_this$video2 = this.video).canPlayType.apply(_this$video2, arguments);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// seek video by time
|
|
477
|
+
}, {
|
|
478
|
+
key: "seek",
|
|
479
|
+
value: function seek(time) {
|
|
480
|
+
this.video.seek(time);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// jump forward x seconds
|
|
484
|
+
}, {
|
|
485
|
+
key: "forward",
|
|
486
|
+
value: function forward(seconds) {
|
|
487
|
+
this.video.forward(seconds);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// jump back x seconds
|
|
491
|
+
}, {
|
|
492
|
+
key: "replay",
|
|
493
|
+
value: function replay(seconds) {
|
|
494
|
+
this.video.replay(seconds);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// enter or exist full screen
|
|
498
|
+
}, {
|
|
499
|
+
key: "toggleFullscreen",
|
|
500
|
+
value: function toggleFullscreen() {
|
|
501
|
+
this.video.toggleFullscreen();
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// subscribe to player state change
|
|
505
|
+
}, {
|
|
506
|
+
key: "subscribeToStateChange",
|
|
507
|
+
value: function subscribeToStateChange(listener) {
|
|
508
|
+
return this.manager.subscribeToPlayerStateChange(listener);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// player resize
|
|
512
|
+
}, {
|
|
513
|
+
key: "handleResize",
|
|
514
|
+
value: function handleResize() {
|
|
515
|
+
var _this$manager$getStat = this.manager.getState(),
|
|
516
|
+
player = _this$manager$getStat.player;
|
|
517
|
+
var leftSectionRef = this._leftSectionRef;
|
|
518
|
+
var rightSectionRef = this._rightSectionRef;
|
|
519
|
+
var audioMeterBlock = this._audioMeterBlock;
|
|
520
|
+
var playerHeader = (0, _reactDom.findDOMNode)(this._playerHeader);
|
|
521
|
+
var video = (0, _reactDom.findDOMNode)(this.video);
|
|
522
|
+
var progressControl = (0, _reactDom.findDOMNode)(this._progressControl);
|
|
523
|
+
var controlBar = (0, _reactDom.findDOMNode)(this._controlBar);
|
|
524
|
+
var playlist = (0, _reactDom.findDOMNode)(this._playlist);
|
|
525
|
+
var playerContainer = (0, _reactDom.findDOMNode)(this._playerContainer);
|
|
526
|
+
var _this$props = this.props,
|
|
527
|
+
controlType = _this$props.controlType,
|
|
528
|
+
playerType = _this$props.playerType,
|
|
529
|
+
fileType = _this$props.fileType;
|
|
530
|
+
var height = 0;
|
|
531
|
+
_toConsumableArray(leftSectionRef.children).forEach(function (child) {
|
|
532
|
+
return height += child.offsetHeight;
|
|
533
|
+
});
|
|
534
|
+
if (rightSectionRef) {
|
|
535
|
+
rightSectionRef.style.height = height + 'px';
|
|
536
|
+
}
|
|
537
|
+
if (audioMeterBlock) {
|
|
538
|
+
audioMeterBlock.style.height = video.offsetHeight + 'px';
|
|
539
|
+
audioMeterBlock.style.top = playerHeader.offsetHeight + 'px';
|
|
540
|
+
this.meterHeight = video.offsetHeight;
|
|
541
|
+
}
|
|
542
|
+
if (playlist) {
|
|
543
|
+
if (fileType === 'image') {
|
|
544
|
+
playlist.style.height = 'calc(100% - ' + (playerHeader.offsetHeight + video.offsetHeight) + 'px)';
|
|
545
|
+
} else {
|
|
546
|
+
playlist.style.height = 'calc(100% - ' + (playerHeader.offsetHeight + video.offsetHeight + progressControl.offsetHeight + controlBar.offsetHeight) + 'px)';
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
var videoHeight = window.innerHeight;
|
|
550
|
+
var videoWidth = window.innerWidth;
|
|
551
|
+
if (playerType === 'panel') {
|
|
552
|
+
videoHeight = window.innerHeight;
|
|
553
|
+
videoWidth = videoHeight * (16 / 9);
|
|
554
|
+
if (videoWidth > window.innerWidth) {
|
|
555
|
+
videoWidth = window.innerWidth;
|
|
556
|
+
videoHeight = videoWidth * (9 / 16);
|
|
557
|
+
}
|
|
558
|
+
video.style.paddingTop = '0';
|
|
559
|
+
video.style.width = videoWidth + 'px';
|
|
560
|
+
video.style.height = videoHeight + 'px';
|
|
561
|
+
video.style.margin = '0 auto';
|
|
562
|
+
video.classList.add('ratio-border');
|
|
563
|
+
} else if (window.innerHeight < 1024 && (playerContainer.offsetHeight > window.innerHeight || window.innerHeight > playerContainer.offsetHeight)) {
|
|
564
|
+
var playlistMinHeight = 150;
|
|
565
|
+
if (controlType === 'default') {
|
|
566
|
+
if (fileType === 'image') {
|
|
567
|
+
videoHeight = window.innerHeight - playlistMinHeight - playerHeader.offsetHeight;
|
|
568
|
+
} else {
|
|
569
|
+
videoHeight = window.innerHeight - playlistMinHeight - playerHeader.offsetHeight - progressControl.offsetHeight - controlBar.offsetHeight;
|
|
570
|
+
}
|
|
571
|
+
} else {
|
|
572
|
+
videoHeight = window.innerHeight - playerHeader.offsetHeight - controlBar.offsetHeight - this._advancedControl.offsetHeight - 30;
|
|
573
|
+
}
|
|
574
|
+
videoWidth = videoHeight * (16 / 9);
|
|
575
|
+
if (videoWidth > leftSectionRef.offsetWidth) {
|
|
576
|
+
videoWidth = leftSectionRef.offsetWidth;
|
|
577
|
+
videoHeight = videoWidth * (9 / 16);
|
|
578
|
+
}
|
|
579
|
+
video.style.paddingTop = '0';
|
|
580
|
+
video.style.width = videoWidth + 'px';
|
|
581
|
+
video.style.height = videoHeight + 'px';
|
|
582
|
+
video.style.margin = '0 auto';
|
|
583
|
+
video.classList.add('ratio-border');
|
|
584
|
+
} else if (window.innerHeight >= 900) {
|
|
585
|
+
video.style.paddingTop = '56.25%';
|
|
586
|
+
video.style.width = 'auto';
|
|
587
|
+
video.style.height = 'auto';
|
|
588
|
+
video.classList.remove('ratio-border');
|
|
589
|
+
}
|
|
590
|
+
if (player.isFullscreen && progressControl) {
|
|
591
|
+
videoHeight = window.innerHeight - playerHeader.offsetHeight - progressControl.offsetHeight - controlBar.offsetHeight;
|
|
592
|
+
videoWidth = videoHeight * (16 / 9);
|
|
593
|
+
if (videoWidth > window.innerWidth) {
|
|
594
|
+
videoWidth = window.innerWidth;
|
|
595
|
+
videoHeight = videoWidth * (9 / 16);
|
|
596
|
+
}
|
|
597
|
+
video.style.paddingTop = '0';
|
|
598
|
+
video.style.width = videoWidth + 'px';
|
|
599
|
+
video.style.height = videoHeight + 'px';
|
|
600
|
+
video.style.margin = '0 auto';
|
|
601
|
+
video.classList.add('ratio-border');
|
|
602
|
+
}
|
|
603
|
+
// this.video.handleResize();
|
|
604
|
+
}
|
|
605
|
+
}, {
|
|
606
|
+
key: "handleFullScreenChange",
|
|
607
|
+
value: function handleFullScreenChange() {
|
|
608
|
+
this.actions.handleFullscreenChange(_fullscreen["default"].isFullscreen);
|
|
609
|
+
}
|
|
610
|
+
}, {
|
|
611
|
+
key: "handleStateChange",
|
|
612
|
+
value: function handleStateChange(state, prevState) {
|
|
613
|
+
if (state.isFullscreen !== prevState.isFullscreen) {
|
|
614
|
+
this.handleResize();
|
|
615
|
+
}
|
|
616
|
+
this.forceUpdate(); // re-render
|
|
617
|
+
}
|
|
618
|
+
}, {
|
|
619
|
+
key: "handleFocus",
|
|
620
|
+
value: function handleFocus() {
|
|
621
|
+
this.actions.activate(true);
|
|
622
|
+
}
|
|
623
|
+
}, {
|
|
624
|
+
key: "handleBlur",
|
|
625
|
+
value: function handleBlur() {
|
|
626
|
+
this.actions.activate(false);
|
|
627
|
+
}
|
|
628
|
+
}, {
|
|
629
|
+
key: "render",
|
|
630
|
+
value: function render() {
|
|
631
|
+
var _this5 = this;
|
|
632
|
+
var _this$manager$getStat2 = this.manager.getState(),
|
|
633
|
+
player = _this$manager$getStat2.player;
|
|
634
|
+
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
635
|
+
player: player,
|
|
636
|
+
actions: this.actions,
|
|
637
|
+
manager: this.manager,
|
|
638
|
+
store: this.manager.store,
|
|
639
|
+
video: this.video ? this.video.video : null
|
|
640
|
+
});
|
|
641
|
+
var childrensLeft = this.getChildren(props, 'left');
|
|
642
|
+
var _this$props2 = this.props,
|
|
643
|
+
rightSection = _this$props2.rightSection,
|
|
644
|
+
playerType = _this$props2.playerType;
|
|
645
|
+
return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
|
|
646
|
+
ref: function ref(c) {
|
|
647
|
+
_this5.manager.rootElement = c;
|
|
648
|
+
},
|
|
649
|
+
role: "region",
|
|
650
|
+
onFocus: this.handleFocus,
|
|
651
|
+
onBlur: this.handleBlur,
|
|
652
|
+
tabIndex: "-1"
|
|
653
|
+
}, /*#__PURE__*/_react["default"].createElement(PlayerContainer, _extends({
|
|
654
|
+
ref: function ref(playerContainer) {
|
|
655
|
+
_this5._playerContainer = playerContainer;
|
|
656
|
+
}
|
|
657
|
+
}, props, {
|
|
658
|
+
hasRightSection: !!rightSection
|
|
659
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
660
|
+
className: "left-video-section",
|
|
661
|
+
ref: function ref(leftSectionRef) {
|
|
662
|
+
_this5._leftSectionRef = leftSectionRef;
|
|
663
|
+
}
|
|
664
|
+
}, childrensLeft), /*#__PURE__*/_react["default"].createElement("div", {
|
|
665
|
+
className: "audio-meter-block ".concat(playerType),
|
|
666
|
+
ref: function ref(audioMeterBlock) {
|
|
667
|
+
_this5._audioMeterBlock = audioMeterBlock;
|
|
668
|
+
}
|
|
669
|
+
}, /*#__PURE__*/_react["default"].createElement(AudioMeterBlock, {
|
|
670
|
+
onClick: function onClick() {
|
|
671
|
+
_this5.meterBlockClick();
|
|
672
|
+
},
|
|
673
|
+
role: "presentation",
|
|
674
|
+
active: true
|
|
675
|
+
}, /*#__PURE__*/_react["default"].createElement(_AudioMeter["default"], {
|
|
676
|
+
player: props.player,
|
|
677
|
+
height: this.meterHeight
|
|
678
|
+
}))), rightSection ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
679
|
+
className: "right-video-section",
|
|
680
|
+
ref: function ref(rightSectionRef) {
|
|
681
|
+
_this5._rightSectionRef = rightSectionRef;
|
|
682
|
+
}
|
|
683
|
+
}, rightSection) : null), props.controlType === 'advanced' ? /*#__PURE__*/_react["default"].createElement(ControlContainer, {
|
|
684
|
+
ref: function ref(advancedControl) {
|
|
685
|
+
_this5._advancedControl = advancedControl;
|
|
686
|
+
}
|
|
687
|
+
}, /*#__PURE__*/_react["default"].createElement(_ProgressControl["default"], _extends({}, props, {
|
|
688
|
+
key: "progress-control",
|
|
689
|
+
order: 1
|
|
690
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_Playlist["default"], _extends({
|
|
691
|
+
ref: function ref(c) {
|
|
692
|
+
_this5._playlist = c;
|
|
693
|
+
},
|
|
694
|
+
key: "playlist",
|
|
695
|
+
order: 5
|
|
696
|
+
}, this.props)));
|
|
697
|
+
}
|
|
698
|
+
}]);
|
|
699
|
+
return Player;
|
|
700
|
+
}(_react.Component);
|
|
701
|
+
Player.contextTypes = {
|
|
702
|
+
store: _propTypes.PropTypes.instanceOf(Object)
|
|
703
|
+
};
|
|
704
|
+
Player.propTypes = propTypes;
|
|
705
|
+
Player.defaultProps = defaultProps;
|
|
706
|
+
Player.displayName = 'Player';
|