@desynova-digital/player 2.1.5 → 3.0.1
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/components/Player.js +2 -2
- package/components/Shortcut.js +22 -11
- package/components/Video.js +187 -121
- package/components/control-bar/ControlBar.js +14 -16
- package/components/marking-controls/MarkingControl.js +4 -3
- package/package.json +1 -1
- package/utils/index.js +1 -1
package/components/Player.js
CHANGED
|
@@ -328,7 +328,7 @@ var Player = function (_Component) {
|
|
|
328
328
|
},
|
|
329
329
|
key: 'control-bar',
|
|
330
330
|
order: 4
|
|
331
|
-
}, this.props)), _react2.default.createElement(_Shortcut2.default, _extends({ key: 'shortcut', order: 99.0 }, props))];
|
|
331
|
+
}, this.props)), _react2.default.createElement(_Shortcut2.default, _extends({ key: 'shortcut', order: 99.0 }, props, { frameRate: fullProps.frameRate }))];
|
|
332
332
|
}
|
|
333
333
|
}, {
|
|
334
334
|
key: 'getImageChildren',
|
|
@@ -385,7 +385,7 @@ var Player = function (_Component) {
|
|
|
385
385
|
},
|
|
386
386
|
key: 'control-bar',
|
|
387
387
|
order: 2
|
|
388
|
-
}, this.props)), _react2.default.createElement(_Shortcut2.default, _extends({ key: 'shortcut', order: 99.0 }, props))];
|
|
388
|
+
}, this.props)), _react2.default.createElement(_Shortcut2.default, _extends({ key: 'shortcut', order: 99.0 }, props, { frameRate: fullProps.frameRate }))];
|
|
389
389
|
}
|
|
390
390
|
}, {
|
|
391
391
|
key: 'getChildren',
|
package/components/Shortcut.js
CHANGED
|
@@ -72,12 +72,12 @@ var Shortcut = function (_Component) {
|
|
|
72
72
|
handle: _this.toggleFullscreen
|
|
73
73
|
}, {
|
|
74
74
|
keyCode: 37, // Left arrow
|
|
75
|
-
handle: function handle(player, actions) {
|
|
75
|
+
handle: function handle(player, actions, frameRate) {
|
|
76
76
|
if (!player.hasStarted) {
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
actions.replay(
|
|
80
|
-
action: '
|
|
79
|
+
actions.replay(1 / frameRate, {
|
|
80
|
+
action: 'forward-' + 1 / frameRate,
|
|
81
81
|
source: 'shortcut'
|
|
82
82
|
}); // Go back 1 frame
|
|
83
83
|
}
|
|
@@ -104,12 +104,12 @@ var Shortcut = function (_Component) {
|
|
|
104
104
|
}
|
|
105
105
|
}, {
|
|
106
106
|
keyCode: 39, // Right arrow
|
|
107
|
-
handle: function handle(player, actions) {
|
|
107
|
+
handle: function handle(player, actions, frameRate) {
|
|
108
108
|
if (!player.hasStarted) {
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
actions.forward(
|
|
112
|
-
action: 'forward-
|
|
111
|
+
actions.forward(1 / frameRate, {
|
|
112
|
+
action: 'forward-' + 1 / frameRate,
|
|
113
113
|
source: 'shortcut'
|
|
114
114
|
}); // Go forward 1 frame
|
|
115
115
|
}
|
|
@@ -152,8 +152,12 @@ var Shortcut = function (_Component) {
|
|
|
152
152
|
var _this$props = _this.props,
|
|
153
153
|
markers = _this$props.markers,
|
|
154
154
|
playerType = _this$props.playerType,
|
|
155
|
-
onAddMarker = _this$props.onAddMarker
|
|
155
|
+
onAddMarker = _this$props.onAddMarker,
|
|
156
|
+
playerReadOnlyMode = _this$props.playerReadOnlyMode;
|
|
156
157
|
|
|
158
|
+
if (playerReadOnlyMode) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
157
161
|
if (playerType !== 'panel') {
|
|
158
162
|
var createPoint = true;
|
|
159
163
|
if (markers && markers.length && markers[0].values && markers[0].values.length) {
|
|
@@ -189,8 +193,12 @@ var Shortcut = function (_Component) {
|
|
|
189
193
|
markers = _this$props2.markers,
|
|
190
194
|
onMarkerSelect = _this$props2.onMarkerSelect,
|
|
191
195
|
playerType = _this$props2.playerType,
|
|
192
|
-
onAddMarker = _this$props2.onAddMarker
|
|
196
|
+
onAddMarker = _this$props2.onAddMarker,
|
|
197
|
+
playerReadOnlyMode = _this$props2.playerReadOnlyMode;
|
|
193
198
|
|
|
199
|
+
if (playerReadOnlyMode) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
194
202
|
if (playerType !== 'panel') {
|
|
195
203
|
var createPoint = true;
|
|
196
204
|
if (markers && markers.length && markers[0].values && markers[0].values.length) {
|
|
@@ -285,6 +293,8 @@ var Shortcut = function (_Component) {
|
|
|
285
293
|
actions.handleVideoPreview(false);
|
|
286
294
|
actions.handleMarkerPointChange('delete');
|
|
287
295
|
onDeleteMarker();
|
|
296
|
+
} else {
|
|
297
|
+
return null;
|
|
288
298
|
}
|
|
289
299
|
}
|
|
290
300
|
}, {
|
|
@@ -369,7 +379,7 @@ var Shortcut = function (_Component) {
|
|
|
369
379
|
} else {
|
|
370
380
|
var time = 1 / frameRate;
|
|
371
381
|
actions.replay(time, {
|
|
372
|
-
action: '
|
|
382
|
+
action: 'forward-' + 1 / frameRate,
|
|
373
383
|
source: 'shortcut'
|
|
374
384
|
});
|
|
375
385
|
}
|
|
@@ -492,7 +502,8 @@ var Shortcut = function (_Component) {
|
|
|
492
502
|
value: function handleKeyPress(e) {
|
|
493
503
|
var _props3 = this.props,
|
|
494
504
|
player = _props3.player,
|
|
495
|
-
actions = _props3.actions
|
|
505
|
+
actions = _props3.actions,
|
|
506
|
+
frameRate = _props3.frameRate;
|
|
496
507
|
|
|
497
508
|
if (!player.isActive) {
|
|
498
509
|
return;
|
|
@@ -517,7 +528,7 @@ var Shortcut = function (_Component) {
|
|
|
517
528
|
})[0];
|
|
518
529
|
|
|
519
530
|
if (shortcut) {
|
|
520
|
-
shortcut.handle(player, actions);
|
|
531
|
+
shortcut.handle(player, actions, frameRate);
|
|
521
532
|
e.preventDefault();
|
|
522
533
|
}
|
|
523
534
|
}
|
package/components/Video.js
CHANGED
|
@@ -40,6 +40,8 @@ var _SDOutline = require('./SDOutline');
|
|
|
40
40
|
|
|
41
41
|
var _SDOutline2 = _interopRequireDefault(_SDOutline);
|
|
42
42
|
|
|
43
|
+
var _components = require('@desynova-digital/components/components');
|
|
44
|
+
|
|
43
45
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
46
|
|
|
45
47
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -94,7 +96,9 @@ var propTypes = {
|
|
|
94
96
|
onRateChange: _propTypes.PropTypes.func,
|
|
95
97
|
onVolumeChange: _propTypes.PropTypes.func,
|
|
96
98
|
onResize: _propTypes.PropTypes.func,
|
|
97
|
-
aspectRatio: _propTypes.PropTypes.string
|
|
99
|
+
aspectRatio: _propTypes.PropTypes.string,
|
|
100
|
+
onPlayerClose: _propTypes.PropTypes.func,
|
|
101
|
+
userEmail: _propTypes.PropTypes.string
|
|
98
102
|
};
|
|
99
103
|
|
|
100
104
|
var defaultProps = {
|
|
@@ -111,7 +115,7 @@ var defaultProps = {
|
|
|
111
115
|
var VideoBlock = _styledComponents2.default.div.withConfig({
|
|
112
116
|
displayName: 'Video__VideoBlock',
|
|
113
117
|
componentId: 'omlcc3-0'
|
|
114
|
-
})(['position:relative;&.video-react-player-block{position:relative;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;video{position:absolute;top:0;left:0;width:100%;height:100%;right:0;bottom:0;}.audio-tracks{position:relative;display:flex;background:rgba(0,0,0,0.5);color:#fff;z-index:10;position:absolute;width:100%;bottom:0;p{cursor:pointer;padding:10px;}}}&.ratio-border{border:1px solid rgba(255,255,255,0.5);&:after{content:\'16:9 Safe Area\';position:absolute;color:#fff;font-family:SFUIText-Regular;font-size:12px;transform:rotate(-90deg);top:20%;left:-50px;}}']);
|
|
118
|
+
})(['position:relative;&.video-react-player-block{position:relative;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;video{position:absolute;top:0;left:0;width:100%;height:100%;right:0;bottom:0;}.audio-tracks{position:relative;display:flex;background:rgba(0,0,0,0.5);color:#fff;z-index:10;position:absolute;width:100%;bottom:0;p{cursor:pointer;padding:10px;}}.loader-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center;position:absolute;z-index:10;background:rgba(0,0,0,0.5)}}&.ratio-border{border:1px solid rgba(255,255,255,0.5);&:after{content:\'16:9 Safe Area\';position:absolute;color:#fff;font-family:SFUIText-Regular;font-size:12px;transform:rotate(-90deg);top:20%;left:-50px;}}']);
|
|
115
119
|
|
|
116
120
|
var Video = function (_Component) {
|
|
117
121
|
_inherits(Video, _Component);
|
|
@@ -123,7 +127,20 @@ var Video = function (_Component) {
|
|
|
123
127
|
|
|
124
128
|
_this.state = {
|
|
125
129
|
audioTracks: [],
|
|
126
|
-
isM3U8: false
|
|
130
|
+
isM3U8: false,
|
|
131
|
+
watermark: {
|
|
132
|
+
'color': 'rgb(255, 255, 255)',
|
|
133
|
+
'position': 'absolute',
|
|
134
|
+
'font-family': 'SFUIText-Regular',
|
|
135
|
+
'text-shadow': '0 0 4px rgb(0 0 0 / 50%)',
|
|
136
|
+
'font-size': '12px',
|
|
137
|
+
'opacity': '0.6',
|
|
138
|
+
'display': 'block',
|
|
139
|
+
'top': '0px',
|
|
140
|
+
'left': '0px'
|
|
141
|
+
},
|
|
142
|
+
watermarkInterval: -1,
|
|
143
|
+
isBuffering: false
|
|
127
144
|
};
|
|
128
145
|
_this.video = null; // the html5 video
|
|
129
146
|
_this.manager = new _Manager2.default(props.store);
|
|
@@ -162,6 +179,7 @@ var Video = function (_Component) {
|
|
|
162
179
|
_this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_this), 250);
|
|
163
180
|
_this.handleKeypress = _this.handleKeypress.bind(_this);
|
|
164
181
|
_this.audioVisualizer = _this.audioVisualizer.bind(_this);
|
|
182
|
+
_this.checkWatermark = _this.checkWatermark.bind(_this);
|
|
165
183
|
return _this;
|
|
166
184
|
}
|
|
167
185
|
|
|
@@ -184,26 +202,75 @@ var Video = function (_Component) {
|
|
|
184
202
|
this.video.src = src;
|
|
185
203
|
}
|
|
186
204
|
this.forceUpdate(); // make sure the children can get the video property
|
|
205
|
+
var watermarkInterval = setInterval(this.checkWatermark, 20000);
|
|
206
|
+
this.setState({
|
|
207
|
+
watermarkInterval: watermarkInterval
|
|
208
|
+
});
|
|
187
209
|
}
|
|
188
210
|
}, {
|
|
189
211
|
key: 'componentWillUnmount',
|
|
190
212
|
value: function componentWillUnmount() {
|
|
191
|
-
var
|
|
213
|
+
var _state = this.state,
|
|
214
|
+
isM3U8 = _state.isM3U8,
|
|
215
|
+
watermarkInterval = _state.watermarkInterval;
|
|
192
216
|
|
|
193
217
|
if (_hls2.default.isSupported() && isM3U8) {
|
|
194
218
|
this.hls.detachMedia();
|
|
195
219
|
} else {
|
|
196
220
|
this.video.src = '';
|
|
197
221
|
}
|
|
222
|
+
clearInterval(watermarkInterval);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* This function is triggered on interval to shuffle the position of watermark on Player area
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
}, {
|
|
230
|
+
key: 'checkWatermark',
|
|
231
|
+
value: function checkWatermark() {
|
|
232
|
+
var watermark = this.state.watermark;
|
|
233
|
+
var _props = this.props,
|
|
234
|
+
onPlayerClose = _props.onPlayerClose,
|
|
235
|
+
userEmail = _props.userEmail;
|
|
236
|
+
|
|
237
|
+
var watermark_text = document.querySelector('#watermark-text');
|
|
238
|
+
var video_player = null;
|
|
239
|
+
var watermark_dimension = null;
|
|
240
|
+
var text_css = null;
|
|
241
|
+
var bool_text = false;
|
|
242
|
+
|
|
243
|
+
if (!watermark_text) {
|
|
244
|
+
onPlayerClose();
|
|
245
|
+
} else {
|
|
246
|
+
video_player = document.querySelector('.video-react-player-block').getBoundingClientRect();
|
|
247
|
+
watermark_dimension = watermark_text.getBoundingClientRect();
|
|
248
|
+
text_css = watermark_text.style;
|
|
249
|
+
bool_text = text_css.position !== 'absolute' || text_css.opacity !== '0.6' || text_css['font-family'] !== 'SFUIText-Regular' && text_css['font-family'] !== '"SFUIText-Regular"';
|
|
250
|
+
bool_text = bool_text || text_css.display !== 'block';
|
|
251
|
+
bool_text = bool_text || text_css.top !== watermark.top;
|
|
252
|
+
bool_text = bool_text || text_css.left !== watermark.left;
|
|
253
|
+
bool_text = bool_text || text_css.length !== 9 || text_css['font-size'] !== '12px';
|
|
254
|
+
bool_text = bool_text || text_css.color !== 'rgb(255, 255, 255)';
|
|
255
|
+
bool_text = bool_text || userEmail !== watermark_text.innerText;
|
|
256
|
+
if (bool_text) {
|
|
257
|
+
onPlayerClose();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
watermark.left = (Math.random() * (video_player.width - watermark_dimension.width)).toFixed(0) + "px";
|
|
261
|
+
watermark.top = (Math.random() * (video_player.height - watermark_dimension.height)).toFixed(0) + "px";
|
|
262
|
+
this.setState({
|
|
263
|
+
watermark: watermark
|
|
264
|
+
});
|
|
198
265
|
}
|
|
199
266
|
}, {
|
|
200
267
|
key: 'setupHLS',
|
|
201
268
|
value: function setupHLS(src) {
|
|
202
269
|
var _this2 = this;
|
|
203
270
|
|
|
204
|
-
var
|
|
205
|
-
actions =
|
|
206
|
-
activeTrackIndex =
|
|
271
|
+
var _props2 = this.props,
|
|
272
|
+
actions = _props2.actions,
|
|
273
|
+
activeTrackIndex = _props2.activeTrackIndex;
|
|
207
274
|
|
|
208
275
|
var self = this;
|
|
209
276
|
// bind them together
|
|
@@ -281,10 +348,10 @@ var Video = function (_Component) {
|
|
|
281
348
|
player = _manager$getState2.player;
|
|
282
349
|
|
|
283
350
|
var style = {};
|
|
284
|
-
var
|
|
285
|
-
aspectRatio =
|
|
286
|
-
width =
|
|
287
|
-
height =
|
|
351
|
+
var _props3 = this.props,
|
|
352
|
+
aspectRatio = _props3.aspectRatio,
|
|
353
|
+
width = _props3.width,
|
|
354
|
+
height = _props3.height;
|
|
288
355
|
/*
|
|
289
356
|
* The aspect ratio is either used directly
|
|
290
357
|
* or to calculate width and height.
|
|
@@ -345,9 +412,9 @@ var Video = function (_Component) {
|
|
|
345
412
|
}, {
|
|
346
413
|
key: 'UNSAFE_componentWillReceiveProps',
|
|
347
414
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
348
|
-
var
|
|
349
|
-
src =
|
|
350
|
-
activeAudio =
|
|
415
|
+
var _props4 = this.props,
|
|
416
|
+
src = _props4.src,
|
|
417
|
+
activeAudio = _props4.player.activeAudio;
|
|
351
418
|
|
|
352
419
|
if (newProps.src !== src) {
|
|
353
420
|
var isM3U8 = this.state.isM3U8;
|
|
@@ -472,9 +539,9 @@ var Video = function (_Component) {
|
|
|
472
539
|
}, {
|
|
473
540
|
key: 'toggleFullscreen',
|
|
474
541
|
value: function toggleFullscreen() {
|
|
475
|
-
var
|
|
476
|
-
player =
|
|
477
|
-
actions =
|
|
542
|
+
var _props5 = this.props,
|
|
543
|
+
player = _props5.player,
|
|
544
|
+
actions = _props5.actions;
|
|
478
545
|
|
|
479
546
|
actions.toggleFullscreen(player);
|
|
480
547
|
}
|
|
@@ -487,10 +554,10 @@ var Video = function (_Component) {
|
|
|
487
554
|
}, {
|
|
488
555
|
key: 'handleLoadStart',
|
|
489
556
|
value: function handleLoadStart() {
|
|
490
|
-
var
|
|
491
|
-
actions =
|
|
492
|
-
onLoadStart =
|
|
493
|
-
fileType =
|
|
557
|
+
var _props6 = this.props,
|
|
558
|
+
actions = _props6.actions,
|
|
559
|
+
onLoadStart = _props6.onLoadStart,
|
|
560
|
+
fileType = _props6.fileType;
|
|
494
561
|
|
|
495
562
|
|
|
496
563
|
if (fileType === 'audio') {
|
|
@@ -511,9 +578,9 @@ var Video = function (_Component) {
|
|
|
511
578
|
}, {
|
|
512
579
|
key: 'handleCanPlay',
|
|
513
580
|
value: function handleCanPlay() {
|
|
514
|
-
var
|
|
515
|
-
actions =
|
|
516
|
-
onCanPlay =
|
|
581
|
+
var _props7 = this.props,
|
|
582
|
+
actions = _props7.actions,
|
|
583
|
+
onCanPlay = _props7.onCanPlay;
|
|
517
584
|
|
|
518
585
|
|
|
519
586
|
actions.handleCanPlay(this.getProperties());
|
|
@@ -531,9 +598,9 @@ var Video = function (_Component) {
|
|
|
531
598
|
}, {
|
|
532
599
|
key: 'handleCanPlayThrough',
|
|
533
600
|
value: function handleCanPlayThrough() {
|
|
534
|
-
var
|
|
535
|
-
actions =
|
|
536
|
-
onCanPlayThrough =
|
|
601
|
+
var _props8 = this.props,
|
|
602
|
+
actions = _props8.actions,
|
|
603
|
+
onCanPlayThrough = _props8.onCanPlayThrough;
|
|
537
604
|
|
|
538
605
|
actions.handleCanPlayThrough(this.getProperties());
|
|
539
606
|
|
|
@@ -550,9 +617,9 @@ var Video = function (_Component) {
|
|
|
550
617
|
}, {
|
|
551
618
|
key: 'handlePlaying',
|
|
552
619
|
value: function handlePlaying() {
|
|
553
|
-
var
|
|
554
|
-
actions =
|
|
555
|
-
onPlaying =
|
|
620
|
+
var _props9 = this.props,
|
|
621
|
+
actions = _props9.actions,
|
|
622
|
+
onPlaying = _props9.onPlaying;
|
|
556
623
|
|
|
557
624
|
actions.handlePlaying(this.getProperties());
|
|
558
625
|
|
|
@@ -566,9 +633,9 @@ var Video = function (_Component) {
|
|
|
566
633
|
}, {
|
|
567
634
|
key: 'handlePlay',
|
|
568
635
|
value: function handlePlay() {
|
|
569
|
-
var
|
|
570
|
-
actions =
|
|
571
|
-
onPlay =
|
|
636
|
+
var _props10 = this.props,
|
|
637
|
+
actions = _props10.actions,
|
|
638
|
+
onPlay = _props10.onPlay;
|
|
572
639
|
|
|
573
640
|
actions.handlePlay(this.getProperties());
|
|
574
641
|
|
|
@@ -582,9 +649,9 @@ var Video = function (_Component) {
|
|
|
582
649
|
}, {
|
|
583
650
|
key: 'handlePause',
|
|
584
651
|
value: function handlePause() {
|
|
585
|
-
var
|
|
586
|
-
actions =
|
|
587
|
-
onPause =
|
|
652
|
+
var _props11 = this.props,
|
|
653
|
+
actions = _props11.actions,
|
|
654
|
+
onPause = _props11.onPause;
|
|
588
655
|
|
|
589
656
|
actions.handlePause(this.getProperties());
|
|
590
657
|
|
|
@@ -601,9 +668,9 @@ var Video = function (_Component) {
|
|
|
601
668
|
}, {
|
|
602
669
|
key: 'handleDurationChange',
|
|
603
670
|
value: function handleDurationChange() {
|
|
604
|
-
var
|
|
605
|
-
actions =
|
|
606
|
-
onDurationChange =
|
|
671
|
+
var _props12 = this.props,
|
|
672
|
+
actions = _props12.actions,
|
|
673
|
+
onDurationChange = _props12.onDurationChange;
|
|
607
674
|
|
|
608
675
|
actions.handleDurationChange(this.getProperties());
|
|
609
676
|
|
|
@@ -620,9 +687,9 @@ var Video = function (_Component) {
|
|
|
620
687
|
}, {
|
|
621
688
|
key: 'handleProgress',
|
|
622
689
|
value: function handleProgress() {
|
|
623
|
-
var
|
|
624
|
-
actions =
|
|
625
|
-
onProgress =
|
|
690
|
+
var _props13 = this.props,
|
|
691
|
+
actions = _props13.actions,
|
|
692
|
+
onProgress = _props13.onProgress;
|
|
626
693
|
|
|
627
694
|
if (this.video) {
|
|
628
695
|
actions.handleProgressChange(this.getProperties());
|
|
@@ -641,11 +708,11 @@ var Video = function (_Component) {
|
|
|
641
708
|
}, {
|
|
642
709
|
key: 'handleEnded',
|
|
643
710
|
value: function handleEnded() {
|
|
644
|
-
var
|
|
645
|
-
loop =
|
|
646
|
-
player =
|
|
647
|
-
actions =
|
|
648
|
-
onEnded =
|
|
711
|
+
var _props14 = this.props,
|
|
712
|
+
loop = _props14.loop,
|
|
713
|
+
player = _props14.player,
|
|
714
|
+
actions = _props14.actions,
|
|
715
|
+
onEnded = _props14.onEnded;
|
|
649
716
|
|
|
650
717
|
if (loop) {
|
|
651
718
|
this.seek(0);
|
|
@@ -665,9 +732,9 @@ var Video = function (_Component) {
|
|
|
665
732
|
}, {
|
|
666
733
|
key: 'handleWaiting',
|
|
667
734
|
value: function handleWaiting() {
|
|
668
|
-
var
|
|
669
|
-
actions =
|
|
670
|
-
onWaiting =
|
|
735
|
+
var _props15 = this.props,
|
|
736
|
+
actions = _props15.actions,
|
|
737
|
+
onWaiting = _props15.onWaiting;
|
|
671
738
|
|
|
672
739
|
actions.handleWaiting(this.getProperties());
|
|
673
740
|
|
|
@@ -684,9 +751,9 @@ var Video = function (_Component) {
|
|
|
684
751
|
}, {
|
|
685
752
|
key: 'handleSeeking',
|
|
686
753
|
value: function handleSeeking() {
|
|
687
|
-
var
|
|
688
|
-
actions =
|
|
689
|
-
onSeeking =
|
|
754
|
+
var _props16 = this.props,
|
|
755
|
+
actions = _props16.actions,
|
|
756
|
+
onSeeking = _props16.onSeeking;
|
|
690
757
|
|
|
691
758
|
actions.handleSeeking(this.getProperties());
|
|
692
759
|
|
|
@@ -703,9 +770,9 @@ var Video = function (_Component) {
|
|
|
703
770
|
}, {
|
|
704
771
|
key: 'handleSeeked',
|
|
705
772
|
value: function handleSeeked() {
|
|
706
|
-
var
|
|
707
|
-
actions =
|
|
708
|
-
onSeeked =
|
|
773
|
+
var _props17 = this.props,
|
|
774
|
+
actions = _props17.actions,
|
|
775
|
+
onSeeked = _props17.onSeeked;
|
|
709
776
|
|
|
710
777
|
actions.handleSeeked(this.getProperties());
|
|
711
778
|
|
|
@@ -728,9 +795,9 @@ var Video = function (_Component) {
|
|
|
728
795
|
}, {
|
|
729
796
|
key: 'handleSuspend',
|
|
730
797
|
value: function handleSuspend() {
|
|
731
|
-
var
|
|
732
|
-
actions =
|
|
733
|
-
onSuspend =
|
|
798
|
+
var _props18 = this.props,
|
|
799
|
+
actions = _props18.actions,
|
|
800
|
+
onSuspend = _props18.onSuspend;
|
|
734
801
|
|
|
735
802
|
actions.handleSuspend(this.getProperties());
|
|
736
803
|
if (onSuspend) {
|
|
@@ -743,9 +810,9 @@ var Video = function (_Component) {
|
|
|
743
810
|
}, {
|
|
744
811
|
key: 'handleAbort',
|
|
745
812
|
value: function handleAbort() {
|
|
746
|
-
var
|
|
747
|
-
actions =
|
|
748
|
-
onAbort =
|
|
813
|
+
var _props19 = this.props,
|
|
814
|
+
actions = _props19.actions,
|
|
815
|
+
onAbort = _props19.onAbort;
|
|
749
816
|
|
|
750
817
|
actions.handleAbort(this.getProperties());
|
|
751
818
|
if (onAbort) {
|
|
@@ -758,9 +825,9 @@ var Video = function (_Component) {
|
|
|
758
825
|
}, {
|
|
759
826
|
key: 'handleEmptied',
|
|
760
827
|
value: function handleEmptied() {
|
|
761
|
-
var
|
|
762
|
-
actions =
|
|
763
|
-
onEmptied =
|
|
828
|
+
var _props20 = this.props,
|
|
829
|
+
actions = _props20.actions,
|
|
830
|
+
onEmptied = _props20.onEmptied;
|
|
764
831
|
|
|
765
832
|
actions.handleEmptied(this.getProperties());
|
|
766
833
|
if (onEmptied) {
|
|
@@ -776,9 +843,9 @@ var Video = function (_Component) {
|
|
|
776
843
|
}, {
|
|
777
844
|
key: 'handleStalled',
|
|
778
845
|
value: function handleStalled() {
|
|
779
|
-
var
|
|
780
|
-
actions =
|
|
781
|
-
onStalled =
|
|
846
|
+
var _props21 = this.props,
|
|
847
|
+
actions = _props21.actions,
|
|
848
|
+
onStalled = _props21.onStalled;
|
|
782
849
|
|
|
783
850
|
actions.handleStalled(this.getProperties());
|
|
784
851
|
|
|
@@ -795,10 +862,10 @@ var Video = function (_Component) {
|
|
|
795
862
|
}, {
|
|
796
863
|
key: 'handleLoadedMetaData',
|
|
797
864
|
value: function handleLoadedMetaData() {
|
|
798
|
-
var
|
|
799
|
-
actions =
|
|
800
|
-
onLoadedMetadata =
|
|
801
|
-
startTime =
|
|
865
|
+
var _props22 = this.props,
|
|
866
|
+
actions = _props22.actions,
|
|
867
|
+
onLoadedMetadata = _props22.onLoadedMetadata,
|
|
868
|
+
startTime = _props22.startTime;
|
|
802
869
|
|
|
803
870
|
|
|
804
871
|
if (startTime && startTime > 0) {
|
|
@@ -820,9 +887,9 @@ var Video = function (_Component) {
|
|
|
820
887
|
}, {
|
|
821
888
|
key: 'handleLoadedData',
|
|
822
889
|
value: function handleLoadedData() {
|
|
823
|
-
var
|
|
824
|
-
actions =
|
|
825
|
-
onLoadedData =
|
|
890
|
+
var _props23 = this.props,
|
|
891
|
+
actions = _props23.actions,
|
|
892
|
+
onLoadedData = _props23.onLoadedData;
|
|
826
893
|
|
|
827
894
|
actions.handleLoadedData(this.getProperties());
|
|
828
895
|
|
|
@@ -839,12 +906,12 @@ var Video = function (_Component) {
|
|
|
839
906
|
}, {
|
|
840
907
|
key: 'handleTimeUpdate',
|
|
841
908
|
value: function handleTimeUpdate() {
|
|
842
|
-
var
|
|
843
|
-
|
|
844
|
-
previewActive =
|
|
845
|
-
rightMarker =
|
|
846
|
-
actions =
|
|
847
|
-
onTimeUpdate =
|
|
909
|
+
var _props24 = this.props,
|
|
910
|
+
_props24$player = _props24.player,
|
|
911
|
+
previewActive = _props24$player.previewActive,
|
|
912
|
+
rightMarker = _props24$player.rightMarker,
|
|
913
|
+
actions = _props24.actions,
|
|
914
|
+
onTimeUpdate = _props24.onTimeUpdate;
|
|
848
915
|
|
|
849
916
|
actions.handleTimeUpdate(this.getProperties());
|
|
850
917
|
if (previewActive && this.video.currentTime >= rightMarker) {
|
|
@@ -864,9 +931,9 @@ var Video = function (_Component) {
|
|
|
864
931
|
}, {
|
|
865
932
|
key: 'handleRateChange',
|
|
866
933
|
value: function handleRateChange() {
|
|
867
|
-
var
|
|
868
|
-
actions =
|
|
869
|
-
onRateChange =
|
|
934
|
+
var _props25 = this.props,
|
|
935
|
+
actions = _props25.actions,
|
|
936
|
+
onRateChange = _props25.onRateChange;
|
|
870
937
|
|
|
871
938
|
actions.handleRateChange(this.getProperties());
|
|
872
939
|
|
|
@@ -880,9 +947,9 @@ var Video = function (_Component) {
|
|
|
880
947
|
}, {
|
|
881
948
|
key: 'handleVolumeChange',
|
|
882
949
|
value: function handleVolumeChange() {
|
|
883
|
-
var
|
|
884
|
-
actions =
|
|
885
|
-
onVolumeChange =
|
|
950
|
+
var _props26 = this.props,
|
|
951
|
+
actions = _props26.actions,
|
|
952
|
+
onVolumeChange = _props26.onVolumeChange;
|
|
886
953
|
|
|
887
954
|
actions.handleVolumeChange(this.getProperties());
|
|
888
955
|
|
|
@@ -899,9 +966,9 @@ var Video = function (_Component) {
|
|
|
899
966
|
}, {
|
|
900
967
|
key: 'handleError',
|
|
901
968
|
value: function handleError() {
|
|
902
|
-
var
|
|
903
|
-
actions =
|
|
904
|
-
onError =
|
|
969
|
+
var _props27 = this.props,
|
|
970
|
+
actions = _props27.actions,
|
|
971
|
+
onError = _props27.onError;
|
|
905
972
|
|
|
906
973
|
actions.handleError(this.getProperties());
|
|
907
974
|
if (onError) {
|
|
@@ -1013,17 +1080,20 @@ var Video = function (_Component) {
|
|
|
1013
1080
|
value: function render() {
|
|
1014
1081
|
var _this5 = this;
|
|
1015
1082
|
|
|
1016
|
-
var
|
|
1017
|
-
loop =
|
|
1018
|
-
poster =
|
|
1019
|
-
preload =
|
|
1020
|
-
autoPlay =
|
|
1021
|
-
playsInline =
|
|
1022
|
-
muted =
|
|
1023
|
-
crossOrigin =
|
|
1024
|
-
videoId =
|
|
1025
|
-
fileType =
|
|
1026
|
-
|
|
1083
|
+
var _props28 = this.props,
|
|
1084
|
+
loop = _props28.loop,
|
|
1085
|
+
poster = _props28.poster,
|
|
1086
|
+
preload = _props28.preload,
|
|
1087
|
+
autoPlay = _props28.autoPlay,
|
|
1088
|
+
playsInline = _props28.playsInline,
|
|
1089
|
+
muted = _props28.muted,
|
|
1090
|
+
crossOrigin = _props28.crossOrigin,
|
|
1091
|
+
videoId = _props28.videoId,
|
|
1092
|
+
fileType = _props28.fileType,
|
|
1093
|
+
userEmail = _props28.userEmail;
|
|
1094
|
+
var _state2 = this.state,
|
|
1095
|
+
isBuffering = _state2.isBuffering,
|
|
1096
|
+
watermark = _state2.watermark;
|
|
1027
1097
|
|
|
1028
1098
|
|
|
1029
1099
|
var children = this.getChildren(this.props);
|
|
@@ -1035,6 +1105,16 @@ var Video = function (_Component) {
|
|
|
1035
1105
|
_this5.playerBlock = c;
|
|
1036
1106
|
},
|
|
1037
1107
|
style: this.getStyle() },
|
|
1108
|
+
isBuffering && _react2.default.createElement(
|
|
1109
|
+
'div',
|
|
1110
|
+
{
|
|
1111
|
+
className: 'loader-container',
|
|
1112
|
+
onClick: function onClick() {
|
|
1113
|
+
return _this5.togglePlay();
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1116
|
+
_react2.default.createElement(_components.Loader, { loaderName: 'SpinningLoader' })
|
|
1117
|
+
) || null,
|
|
1038
1118
|
fileType === 'audio' ? _react2.default.createElement(
|
|
1039
1119
|
_react2.default.Fragment,
|
|
1040
1120
|
null,
|
|
@@ -1129,26 +1209,12 @@ var Video = function (_Component) {
|
|
|
1129
1209
|
_react2.default.createElement('track', { kind: 'captions' }),
|
|
1130
1210
|
this.renderChildren()
|
|
1131
1211
|
),
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
{
|
|
1139
|
-
key: track.id,
|
|
1140
|
-
onClick: function onClick() {
|
|
1141
|
-
_this5.changeAudio(track.id);
|
|
1142
|
-
},
|
|
1143
|
-
role: 'presentation'
|
|
1144
|
-
},
|
|
1145
|
-
track.name,
|
|
1146
|
-
'-',
|
|
1147
|
-
track.groupId
|
|
1148
|
-
);
|
|
1149
|
-
})
|
|
1150
|
-
) : null,
|
|
1151
|
-
children
|
|
1212
|
+
children,
|
|
1213
|
+
_react2.default.createElement(
|
|
1214
|
+
'p',
|
|
1215
|
+
{ className: 'user-name-wrapper', id: 'watermark-text', style: _extends({}, watermark) },
|
|
1216
|
+
userEmail
|
|
1217
|
+
)
|
|
1152
1218
|
);
|
|
1153
1219
|
}
|
|
1154
1220
|
}, {
|
|
@@ -58,10 +58,6 @@ var _VolumeMenuButton = require('./VolumeMenuButton');
|
|
|
58
58
|
|
|
59
59
|
var _VolumeMenuButton2 = _interopRequireDefault(_VolumeMenuButton);
|
|
60
60
|
|
|
61
|
-
var _EditorControlMenuButton = require('./EditorControlMenuButton');
|
|
62
|
-
|
|
63
|
-
var _EditorControlMenuButton2 = _interopRequireDefault(_EditorControlMenuButton);
|
|
64
|
-
|
|
65
61
|
var _utils = require('../../utils');
|
|
66
62
|
|
|
67
63
|
var _colors = require('../../colors');
|
|
@@ -138,13 +134,14 @@ var ControlBar = function (_Component) {
|
|
|
138
134
|
order: 5.1
|
|
139
135
|
})), _react2.default.createElement(_TimeDivider2.default, _extends({}, this.props, { key: 'time-divider', order: 5.2 })), _react2.default.createElement(_DurationDisplay2.default, _extends({}, this.props, { key: 'duration-display', order: 5.3 })), _react2.default.createElement(_MarkingControl2.default, _extends({}, this.props, { key: 'marking-controls', order: 6 })),
|
|
140
136
|
// <CommentsButton {...this.props} key="comments-button" order={6.01} />,
|
|
141
|
-
|
|
137
|
+
// <EditorControlMenuButton
|
|
138
|
+
// style={{ margin: 'auto 10px auto auto' }}
|
|
139
|
+
// {...this.props}
|
|
140
|
+
// key="edit-menu-button"
|
|
141
|
+
// order={6.1}
|
|
142
|
+
// />,
|
|
143
|
+
_react2.default.createElement(_VolumeMenuButton2.default, _extends({
|
|
142
144
|
style: { margin: 'auto 10px auto auto' }
|
|
143
|
-
}, this.props, {
|
|
144
|
-
key: 'edit-menu-button',
|
|
145
|
-
order: 6.1
|
|
146
|
-
})), _react2.default.createElement(_VolumeMenuButton2.default, _extends({
|
|
147
|
-
style: playerType === 'snp_edit' || playerType === 'dubbing_review' ? { margin: '0 10px 0 0' } : { margin: 'auto 10px auto auto' }
|
|
148
145
|
}, this.props, {
|
|
149
146
|
key: 'volume-menu-button',
|
|
150
147
|
order: 7
|
|
@@ -172,13 +169,14 @@ var ControlBar = function (_Component) {
|
|
|
172
169
|
// key="zoom-menu-button"
|
|
173
170
|
// order={7}
|
|
174
171
|
// />, */}
|
|
175
|
-
|
|
172
|
+
// <EditorControlMenuButton
|
|
173
|
+
// style={{ margin: 'auto 10px auto auto' }}
|
|
174
|
+
// {...this.props}
|
|
175
|
+
// key="edit-menu-button"
|
|
176
|
+
// order={7}
|
|
177
|
+
// />,
|
|
178
|
+
_react2.default.createElement(_VolumeMenuButton2.default, _extends({
|
|
176
179
|
style: { margin: 'auto 10px auto auto' }
|
|
177
|
-
}, this.props, {
|
|
178
|
-
key: 'edit-menu-button',
|
|
179
|
-
order: 7
|
|
180
|
-
})), _react2.default.createElement(_VolumeMenuButton2.default, _extends({
|
|
181
|
-
style: playerType === 'snp_edit' || playerType === 'dubbing_review' ? { margin: '0 10px 0 0' } : { margin: 'auto 10px auto auto' }
|
|
182
180
|
}, this.props, {
|
|
183
181
|
key: 'volume-menu-button',
|
|
184
182
|
order: 8
|
|
@@ -77,12 +77,13 @@ function MarkingControl(_ref) {
|
|
|
77
77
|
markers = _ref.markers,
|
|
78
78
|
controlType = _ref.controlType,
|
|
79
79
|
playerType = _ref.playerType,
|
|
80
|
-
allowMarkerOverlap = _ref.allowMarkerOverlap
|
|
80
|
+
allowMarkerOverlap = _ref.allowMarkerOverlap,
|
|
81
|
+
playerReadOnlyMode = _ref.playerReadOnlyMode;
|
|
81
82
|
|
|
82
83
|
return _react2.default.createElement(
|
|
83
84
|
_react2.default.Fragment,
|
|
84
85
|
null,
|
|
85
|
-
playerType !== 'panel' && playerType !== 'default' && playerType !== 'clipping_default' ? _react2.default.createElement(
|
|
86
|
+
playerType !== 'panel' && playerType !== 'default' && playerType !== 'clipping_default' && !playerReadOnlyMode ? _react2.default.createElement(
|
|
86
87
|
MarkingBlock,
|
|
87
88
|
null,
|
|
88
89
|
(!(player.leftMarker > -1) || !(player.rightMarker > -1)) && playerType !== 'panel' && playerType !== 'default' && playerType !== 'clipping_default' ? _react2.default.createElement(
|
|
@@ -115,7 +116,7 @@ function MarkingControl(_ref) {
|
|
|
115
116
|
player.leftMarker > -1 && player.rightMarker > -1 ? _react2.default.createElement(
|
|
116
117
|
_react2.default.Fragment,
|
|
117
118
|
null,
|
|
118
|
-
player.markerType === 'create' && controlType === 'advanced' &&
|
|
119
|
+
player.markerType === 'create' && controlType === 'advanced' && player.markerCreate ? _react2.default.createElement(_MarkingAddButton2.default, {
|
|
119
120
|
leftMarker: player.leftMarker,
|
|
120
121
|
rightMarker: player.rightMarker,
|
|
121
122
|
onAddMarker: onAddMarker,
|
package/package.json
CHANGED
package/utils/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function secondsToTime() {
|
|
|
48
48
|
_seconds += initialTime;
|
|
49
49
|
}
|
|
50
50
|
var date = new Date(null);
|
|
51
|
-
var currentFrame = Math.floor(_seconds *
|
|
51
|
+
var currentFrame = Math.floor(_seconds * frameRate % frameRate);
|
|
52
52
|
var paddedFrame = currentFrame < 10 ? '0' + currentFrame : currentFrame;
|
|
53
53
|
date.setSeconds(_seconds);
|
|
54
54
|
var timeString = date.toISOString().substr(11, 8);
|