@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
|
@@ -1,68 +1,41 @@
|
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
var _Slider = require('../Slider');
|
|
22
|
-
|
|
23
|
-
var _Slider2 = _interopRequireDefault(_Slider);
|
|
24
|
-
|
|
25
|
-
var _PlayProgressBar = require('./PlayProgressBar');
|
|
26
|
-
|
|
27
|
-
var _PlayProgressBar2 = _interopRequireDefault(_PlayProgressBar);
|
|
28
|
-
|
|
29
|
-
var _utils = require('../../utils');
|
|
30
|
-
|
|
31
|
-
var _Timeline = require('./Timeline');
|
|
32
|
-
|
|
33
|
-
var _Timeline2 = _interopRequireDefault(_Timeline);
|
|
34
|
-
|
|
35
|
-
var _MarkerBar = require('../MarkerBar');
|
|
36
|
-
|
|
37
|
-
var _MarkerBar2 = _interopRequireDefault(_MarkerBar);
|
|
38
|
-
|
|
39
|
-
var _TagsBar = require('../TagsBar');
|
|
40
|
-
|
|
41
|
-
var _TagsBar2 = _interopRequireDefault(_TagsBar);
|
|
42
|
-
|
|
43
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
11
|
+
var _Slider = _interopRequireDefault(require("../Slider"));
|
|
12
|
+
var _PlayProgressBar = _interopRequireDefault(require("./PlayProgressBar"));
|
|
13
|
+
var _utils = require("../../utils");
|
|
14
|
+
var _Timeline = _interopRequireDefault(require("./Timeline"));
|
|
15
|
+
var _MarkerBar = _interopRequireDefault(require("../MarkerBar"));
|
|
16
|
+
var _TagsBar = _interopRequireDefault(require("../TagsBar"));
|
|
17
|
+
var _templateObject, _templateObject2; // import AudioWaveform from './AudioWaveform';
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
21
|
+
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); }
|
|
45
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
23
|
+
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); } }
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
+
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); }
|
|
27
|
+
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); }
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
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); }; }
|
|
30
|
+
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); }
|
|
31
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
+
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; } }
|
|
33
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
34
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
54
35
|
// import MouseTimeDisplay from './MouseTimeDisplay';
|
|
55
36
|
|
|
56
|
-
var AdvancedControlBlock =
|
|
57
|
-
|
|
58
|
-
componentId: 'sc-1rz7p7m-0'
|
|
59
|
-
})(['width:100%;height:46px;position:relative;cursor:pointer;z-index:1;']);
|
|
60
|
-
|
|
61
|
-
var SliderBlock = _styledComponents2.default.div.withConfig({
|
|
62
|
-
displayName: 'SeekBar__SliderBlock',
|
|
63
|
-
componentId: 'sc-1rz7p7m-1'
|
|
64
|
-
})(['width:100%;height:4px;position:relative;cursor:pointer;z-index:2;']);
|
|
65
|
-
|
|
37
|
+
var AdvancedControlBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 46px;\n position: relative;\n cursor: pointer;\n z-index: 1;\n"])));
|
|
38
|
+
var SliderBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n height: 4px;\n position: relative;\n cursor: pointer;\n z-index: 2;\n"])));
|
|
66
39
|
var propTypes = {
|
|
67
40
|
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
68
41
|
player: _propTypes.PropTypes.instanceOf(Object),
|
|
@@ -72,35 +45,30 @@ var propTypes = {
|
|
|
72
45
|
assetType: _propTypes.PropTypes.oneOf(['fc', 'rc']),
|
|
73
46
|
playerType: _propTypes.PropTypes.oneOf(['dubbing_review', 'clipping_default', 'default', 'tagging', 'qc', 'subtitle', 'snp_edit', 'archive', 'restore', 'clipping', 'storyboard', 'panel'])
|
|
74
47
|
};
|
|
75
|
-
|
|
76
|
-
var SeekBar = function (_Component) {
|
|
48
|
+
var SeekBar = /*#__PURE__*/function (_Component) {
|
|
77
49
|
_inherits(SeekBar, _Component);
|
|
78
|
-
|
|
50
|
+
var _super = _createSuper(SeekBar);
|
|
79
51
|
function SeekBar(props, context) {
|
|
52
|
+
var _this;
|
|
80
53
|
_classCallCheck(this, SeekBar);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
_this.
|
|
85
|
-
_this.
|
|
86
|
-
_this.
|
|
87
|
-
_this.
|
|
88
|
-
|
|
89
|
-
_this.handleMouseDown = _this.handleMouseDown.bind(_this);
|
|
90
|
-
_this.handleMouseMove = _this.handleMouseMove.bind(_this);
|
|
91
|
-
_this.handleMouseUp = _this.handleMouseUp.bind(_this);
|
|
92
|
-
|
|
54
|
+
_this = _super.call(this, props, context);
|
|
55
|
+
_this.getPercent = _this.getPercent.bind(_assertThisInitialized(_this));
|
|
56
|
+
_this.getNewTime = _this.getNewTime.bind(_assertThisInitialized(_this));
|
|
57
|
+
_this.stepForward = _this.stepForward.bind(_assertThisInitialized(_this));
|
|
58
|
+
_this.stepBack = _this.stepBack.bind(_assertThisInitialized(_this));
|
|
59
|
+
_this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_this));
|
|
60
|
+
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
61
|
+
_this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_this));
|
|
93
62
|
_this.state = {
|
|
94
63
|
sliderActive: false
|
|
95
64
|
};
|
|
96
65
|
return _this;
|
|
97
66
|
}
|
|
98
|
-
|
|
99
67
|
_createClass(SeekBar, [{
|
|
100
|
-
key:
|
|
68
|
+
key: "componentDidMount",
|
|
101
69
|
value: function componentDidMount() {}
|
|
102
70
|
}, {
|
|
103
|
-
key:
|
|
71
|
+
key: "componentDidUpdate",
|
|
104
72
|
value: function componentDidUpdate() {}
|
|
105
73
|
|
|
106
74
|
/**
|
|
@@ -109,24 +77,21 @@ var SeekBar = function (_Component) {
|
|
|
109
77
|
* @return {Number} Percentage played
|
|
110
78
|
* @method getPercent
|
|
111
79
|
*/
|
|
112
|
-
|
|
113
80
|
}, {
|
|
114
|
-
key:
|
|
81
|
+
key: "getPercent",
|
|
115
82
|
value: function getPercent() {
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
83
|
+
var _this$props$player = this.props.player,
|
|
84
|
+
currentTime = _this$props$player.currentTime,
|
|
85
|
+
seekingTime = _this$props$player.seekingTime,
|
|
86
|
+
duration = _this$props$player.duration;
|
|
121
87
|
var time = seekingTime || currentTime;
|
|
122
88
|
var percent = time / duration;
|
|
123
89
|
return percent >= 1 ? 1 : percent;
|
|
124
90
|
}
|
|
125
91
|
}, {
|
|
126
|
-
key:
|
|
92
|
+
key: "getNewTime",
|
|
127
93
|
value: function getNewTime(event) {
|
|
128
94
|
var duration = this.props.player.duration;
|
|
129
|
-
|
|
130
95
|
var distance = this.slider.calculateDistance(event);
|
|
131
96
|
var newTime = distance * duration;
|
|
132
97
|
|
|
@@ -134,128 +99,95 @@ var SeekBar = function (_Component) {
|
|
|
134
99
|
return newTime === duration ? newTime - 0.1 : newTime;
|
|
135
100
|
}
|
|
136
101
|
}, {
|
|
137
|
-
key:
|
|
102
|
+
key: "handleMouseDown",
|
|
138
103
|
value: function handleMouseDown() {
|
|
139
104
|
console.log('handleMouse handleMouseDown');
|
|
140
|
-
this.setState({
|
|
105
|
+
this.setState({
|
|
106
|
+
sliderActive: true
|
|
107
|
+
});
|
|
141
108
|
}
|
|
142
109
|
}, {
|
|
143
|
-
key:
|
|
110
|
+
key: "handleMouseUp",
|
|
144
111
|
value: function handleMouseUp(event) {
|
|
145
112
|
console.log('handleMouse handleMouseUp');
|
|
146
113
|
var actions = this.props.actions;
|
|
147
|
-
|
|
148
114
|
var newTime = this.getNewTime(event);
|
|
149
115
|
// Set new time (tell video to seek to new time)
|
|
150
116
|
actions.seek(newTime);
|
|
151
117
|
actions.handleEndSeeking(newTime);
|
|
152
|
-
this.setState({
|
|
118
|
+
this.setState({
|
|
119
|
+
sliderActive: false
|
|
120
|
+
});
|
|
153
121
|
}
|
|
154
122
|
}, {
|
|
155
|
-
key:
|
|
123
|
+
key: "handleMouseMove",
|
|
156
124
|
value: function handleMouseMove(event) {
|
|
157
125
|
var sliderActive = this.state.sliderActive;
|
|
158
|
-
|
|
159
126
|
if (sliderActive) {
|
|
160
127
|
var actions = this.props.actions;
|
|
161
|
-
|
|
162
128
|
var newTime = this.getNewTime(event);
|
|
163
129
|
actions.handleSeekingTime(newTime);
|
|
164
130
|
}
|
|
165
131
|
}
|
|
166
132
|
}, {
|
|
167
|
-
key:
|
|
133
|
+
key: "stepForward",
|
|
168
134
|
value: function stepForward() {
|
|
169
135
|
var actions = this.props.actions;
|
|
170
|
-
|
|
171
136
|
actions.forward(0.04);
|
|
172
137
|
}
|
|
173
138
|
}, {
|
|
174
|
-
key:
|
|
139
|
+
key: "stepBack",
|
|
175
140
|
value: function stepBack() {
|
|
176
141
|
var actions = this.props.actions;
|
|
177
|
-
|
|
178
142
|
actions.replay(0.04);
|
|
179
143
|
}
|
|
180
144
|
}, {
|
|
181
|
-
key:
|
|
145
|
+
key: "render",
|
|
182
146
|
value: function render() {
|
|
183
147
|
var _this2 = this;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
assetType = _props.assetType;
|
|
195
|
-
|
|
148
|
+
var _this$props = this.props,
|
|
149
|
+
_this$props$player2 = _this$props.player,
|
|
150
|
+
currentTime = _this$props$player2.currentTime,
|
|
151
|
+
seekingTime = _this$props$player2.seekingTime,
|
|
152
|
+
duration = _this$props$player2.duration,
|
|
153
|
+
isFullscreen = _this$props$player2.isFullscreen,
|
|
154
|
+
controlType = _this$props.controlType,
|
|
155
|
+
playerType = _this$props.playerType,
|
|
156
|
+
tagsMarker = _this$props.tagsMarker,
|
|
157
|
+
assetType = _this$props.assetType;
|
|
196
158
|
var time = seekingTime || currentTime;
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
stepForward: this.stepForward,
|
|
226
|
-
stepBack: this.stepBack
|
|
227
|
-
},
|
|
228
|
-
_react2.default.createElement(_PlayProgressBar2.default, _extends({
|
|
229
|
-
currentTime: time,
|
|
230
|
-
duration: duration,
|
|
231
|
-
playerType: playerType,
|
|
232
|
-
assetType: assetType
|
|
233
|
-
}, this.props))
|
|
234
|
-
)
|
|
235
|
-
),
|
|
236
|
-
controlType === 'advanced' && !isFullscreen ? _react2.default.createElement(
|
|
237
|
-
_react2.default.Fragment,
|
|
238
|
-
null,
|
|
239
|
-
_react2.default.createElement(
|
|
240
|
-
AdvancedControlBlock,
|
|
241
|
-
null,
|
|
242
|
-
_react2.default.createElement(_Timeline2.default, _extends({}, this.props, {
|
|
243
|
-
ref: function ref(c) {
|
|
244
|
-
_this2.timeline = c;
|
|
245
|
-
}
|
|
246
|
-
}))
|
|
247
|
-
)
|
|
248
|
-
) : null
|
|
249
|
-
)
|
|
250
|
-
);
|
|
159
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_MarkerBar["default"], this.props), tagsMarker && tagsMarker.length ? /*#__PURE__*/_react["default"].createElement(_TagsBar["default"], this.props) : null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
160
|
+
onMouseDown: this.handleMouseDown,
|
|
161
|
+
onMouseMove: this.handleMouseMove,
|
|
162
|
+
onMouseUp: this.handleMouseUp
|
|
163
|
+
}, /*#__PURE__*/_react["default"].createElement(SliderBlock, null, /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
164
|
+
ref: function ref(input) {
|
|
165
|
+
_this2.slider = input;
|
|
166
|
+
},
|
|
167
|
+
label: "video progress bar",
|
|
168
|
+
valuenow: (this.getPercent() * 100).toFixed(2),
|
|
169
|
+
valuetext: (0, _utils.formatTime)(time, duration)
|
|
170
|
+
// onMouseDown={this.handleMouseDown}
|
|
171
|
+
// onMouseMove={this.handleMouseMove}
|
|
172
|
+
// onMouseUp={this.handleMouseUp}
|
|
173
|
+
,
|
|
174
|
+
getPercent: this.getPercent,
|
|
175
|
+
stepForward: this.stepForward,
|
|
176
|
+
stepBack: this.stepBack
|
|
177
|
+
}, /*#__PURE__*/_react["default"].createElement(_PlayProgressBar["default"], _extends({
|
|
178
|
+
currentTime: time,
|
|
179
|
+
duration: duration,
|
|
180
|
+
playerType: playerType,
|
|
181
|
+
assetType: assetType
|
|
182
|
+
}, this.props)))), controlType === 'advanced' && !isFullscreen ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(AdvancedControlBlock, null, /*#__PURE__*/_react["default"].createElement(_Timeline["default"], _extends({}, this.props, {
|
|
183
|
+
ref: function ref(c) {
|
|
184
|
+
_this2.timeline = c;
|
|
185
|
+
}
|
|
186
|
+
})))) : null));
|
|
251
187
|
}
|
|
252
188
|
}]);
|
|
253
|
-
|
|
254
189
|
return SeekBar;
|
|
255
190
|
}(_react.Component);
|
|
256
|
-
|
|
257
|
-
exports.default = SeekBar;
|
|
258
|
-
|
|
259
|
-
|
|
191
|
+
exports["default"] = SeekBar;
|
|
260
192
|
SeekBar.displayName = 'SeekBar';
|
|
261
193
|
SeekBar.propTypes = propTypes;
|
|
@@ -1,71 +1,61 @@
|
|
|
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 _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
18
|
-
|
|
19
|
-
var _propTypes = require('prop-types');
|
|
20
|
-
|
|
21
|
-
var _components = require('@desynova-digital/components');
|
|
22
|
-
|
|
23
|
-
var _utils = require('../../utils');
|
|
24
|
-
|
|
25
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactDom = require("react-dom");
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _propTypes = require("prop-types");
|
|
12
|
+
var _components = require("@desynova-digital/components");
|
|
13
|
+
var _utils = require("../../utils");
|
|
14
|
+
var _templateObject;
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
+
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); }
|
|
17
|
+
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
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
|
|
19
|
+
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); } }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
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); }
|
|
23
|
+
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); }
|
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
+
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); }; }
|
|
26
|
+
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); }
|
|
27
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
+
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; } }
|
|
29
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
33
31
|
var propTypes = {
|
|
34
32
|
player: _propTypes.PropTypes.instanceOf(Object),
|
|
35
33
|
initialTime: _propTypes.PropTypes.number,
|
|
36
34
|
frameRate: _propTypes.PropTypes.number
|
|
37
35
|
};
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
displayName: 'Timeline__TimelineBlock',
|
|
41
|
-
componentId: 'sc-1qvrkuc-0'
|
|
42
|
-
})(['display:flex;justify-content:space-between;align-items:stretch;position:absolute;width:100%;height:100%;top:0px;left:0;.player-time{width:100%;position:relative;height:46px;user-select:none;&:first-child{p{left:0px;}}&:last-child{width:10px;', '{display:none;}p{left:auto;right:0px;}}', '{position:absolute;left:0;bottom:0;}p{color:#aaa;font-size:10px;font-family:SFUIText-Regular;left:-28px;top:10px;letter-spacing:0.5px;position:absolute;user-select:none;}}'], _components.Icon.Element, _components.Icon.Element);
|
|
43
|
-
|
|
44
|
-
var Timeline = function (_Component) {
|
|
36
|
+
var TimelineBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: stretch;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0;\n .player-time {\n width: 100%;\n position: relative;\n height: 46px;\n user-select: none;\n &:first-child {\n p {\n left: 0px;\n }\n }\n &:last-child {\n width: 10px;\n ", " {\n display: none;\n }\n p {\n left: auto;\n right: 0px;\n }\n }\n ", " {\n position: absolute;\n left: 0;\n bottom: 0;\n }\n p {\n color: #aaa;\n font-size: 10px;\n font-family: SFUIText-Regular;\n left: -28px;\n top: 10px;\n letter-spacing: 0.5px;\n position: absolute;\n user-select: none;\n }\n }\n"])), _components.Icon.Element, _components.Icon.Element);
|
|
37
|
+
var Timeline = /*#__PURE__*/function (_Component) {
|
|
45
38
|
_inherits(Timeline, _Component);
|
|
46
|
-
|
|
39
|
+
var _super = _createSuper(Timeline);
|
|
47
40
|
function Timeline(props, context) {
|
|
41
|
+
var _this;
|
|
48
42
|
_classCallCheck(this, Timeline);
|
|
49
|
-
|
|
50
|
-
var _this = _possibleConstructorReturn(this, (Timeline.__proto__ || Object.getPrototypeOf(Timeline)).call(this, props, context));
|
|
51
|
-
|
|
43
|
+
_this = _super.call(this, props, context);
|
|
52
44
|
_this.state = {
|
|
53
45
|
timeArray: []
|
|
54
46
|
};
|
|
55
|
-
_this.generateTimeline = _this.generateTimeline.bind(_this);
|
|
47
|
+
_this.generateTimeline = _this.generateTimeline.bind(_assertThisInitialized(_this));
|
|
56
48
|
return _this;
|
|
57
49
|
}
|
|
58
|
-
|
|
59
50
|
_createClass(Timeline, [{
|
|
60
|
-
key:
|
|
51
|
+
key: "componentDidMount",
|
|
61
52
|
value: function componentDidMount() {
|
|
62
53
|
this.generateTimeline();
|
|
63
54
|
}
|
|
64
55
|
}, {
|
|
65
|
-
key:
|
|
56
|
+
key: "generateTimeline",
|
|
66
57
|
value: function generateTimeline() {
|
|
67
58
|
var player = this.props.player;
|
|
68
|
-
|
|
69
59
|
var timelineBlock = (0, _reactDom.findDOMNode)(this.timelineBlock);
|
|
70
60
|
var perTimeWidth = 100;
|
|
71
61
|
var sliderWidth = timelineBlock.offsetWidth;
|
|
@@ -82,53 +72,39 @@ var Timeline = function (_Component) {
|
|
|
82
72
|
break;
|
|
83
73
|
}
|
|
84
74
|
}
|
|
85
|
-
this.setState({
|
|
75
|
+
this.setState({
|
|
76
|
+
timeArray: timeArray
|
|
77
|
+
});
|
|
86
78
|
}
|
|
87
79
|
}, {
|
|
88
|
-
key:
|
|
80
|
+
key: "render",
|
|
89
81
|
value: function render() {
|
|
90
82
|
var _this2 = this;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
frameRate = _props.frameRate;
|
|
83
|
+
var _this$props = this.props,
|
|
84
|
+
initialTime = _this$props.initialTime,
|
|
85
|
+
frameRate = _this$props.frameRate;
|
|
95
86
|
var timeArray = this.state.timeArray;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
return /*#__PURE__*/_react["default"].createElement(TimelineBlock, {
|
|
88
|
+
ref: function ref(c) {
|
|
89
|
+
_this2.timelineBlock = c;
|
|
90
|
+
}
|
|
91
|
+
}, timeArray.map(function (time) {
|
|
92
|
+
var formattedTime = (0, _utils.secondsToTime)(time, frameRate, initialTime);
|
|
93
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
94
|
+
className: "player-time",
|
|
100
95
|
ref: function ref(c) {
|
|
101
|
-
_this2.
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
className: 'player-time',
|
|
110
|
-
ref: function ref(c) {
|
|
111
|
-
_this2.timelineContainer = c;
|
|
112
|
-
},
|
|
113
|
-
key: time
|
|
114
|
-
},
|
|
115
|
-
_react2.default.createElement(
|
|
116
|
-
'p',
|
|
117
|
-
null,
|
|
118
|
-
formattedTime
|
|
119
|
-
),
|
|
120
|
-
_react2.default.createElement(_components.Icon, { name: 'timeline', stroke: '#aaa' })
|
|
121
|
-
);
|
|
122
|
-
})
|
|
123
|
-
);
|
|
96
|
+
_this2.timelineContainer = c;
|
|
97
|
+
},
|
|
98
|
+
key: time
|
|
99
|
+
}, /*#__PURE__*/_react["default"].createElement("p", null, formattedTime), /*#__PURE__*/_react["default"].createElement(_components.Icon, {
|
|
100
|
+
name: "timeline",
|
|
101
|
+
stroke: "#aaa"
|
|
102
|
+
}));
|
|
103
|
+
}));
|
|
124
104
|
}
|
|
125
105
|
}]);
|
|
126
|
-
|
|
127
106
|
return Timeline;
|
|
128
107
|
}(_react.Component);
|
|
129
|
-
|
|
130
|
-
exports.default = Timeline;
|
|
131
|
-
|
|
132
|
-
|
|
108
|
+
exports["default"] = Timeline;
|
|
133
109
|
Timeline.propTypes = propTypes;
|
|
134
110
|
Timeline.displayName = 'Timeline';
|