@desynova-digital/player 3.1.3 → 3.2.3
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/PointersBar.js +33 -19
- package/components/Shortcut.js +12 -17
- package/components/Video.js +162 -63
- package/components/control-bar/ControlBar.js +7 -0
- package/components/control-bar/SubtitleLanguagesMenuButton.js +133 -0
- package/components/marking-controls/MarkOutControl.js +8 -4
- package/components/marking-controls/MarkingControl.js +2 -11
- package/components/settings-menu-control/PlaybackRateControl.js +9 -9
- package/package.json +1 -1
|
@@ -64,7 +64,9 @@ var MarkerTagsBlock = _styledComponents2.default.div.withConfig({
|
|
|
64
64
|
var ToolTipStyles = _styledComponents2.default.div.withConfig({
|
|
65
65
|
displayName: 'PointersBar__ToolTipStyles',
|
|
66
66
|
componentId: 'b8687a-3'
|
|
67
|
-
})(['position:absolute;z-index:2;height:18px;transition:left .1s ease-in-out;.tooltip-container{border-radius:0.25rem;padding:5px;width:fit-content;background:#FFFFFF;;color:#666666;h4{white-space:nowrap;font-size:12px;}&:after{content:\'\';position:absolute;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid white;
|
|
67
|
+
})(['position:absolute;z-index:2;height:18px;transition:left .1s ease-in-out;.tooltip-container{border-radius:0.25rem;padding:5px;width:fit-content;background:#FFFFFF;;color:#666666;h4{white-space:nowrap;font-size:12px;}&:after{content:\'\';position:absolute;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid white;', ' left:50%;transform:translateX(-50%);}}'], function (props) {
|
|
68
|
+
return props.multiline ? "bottom: -21px;" : "bottom: -9px;";
|
|
69
|
+
});
|
|
68
70
|
|
|
69
71
|
var PointersBar = function (_Component) {
|
|
70
72
|
_inherits(PointersBar, _Component);
|
|
@@ -128,7 +130,8 @@ var PointersBar = function (_Component) {
|
|
|
128
130
|
|
|
129
131
|
tooltip.isVisible = false;
|
|
130
132
|
tooltip.text = title;
|
|
131
|
-
tooltip.
|
|
133
|
+
tooltip.bottom = window.innerHeight - e.target.getBoundingClientRect().top; // e.target.getBoundingClientRect().top - e.target.getBoundingClientRect().height - 10;
|
|
134
|
+
tooltip.bottom = title.line1 ? tooltip.bottom + 22 : tooltip.bottom + 10;
|
|
132
135
|
tooltip.left = e.target.getBoundingClientRect().left + (e.target.getBoundingClientRect().right - e.target.getBoundingClientRect().left) / 2;
|
|
133
136
|
this.setState(_extends({}, tooltip), function () {
|
|
134
137
|
var tooltip = _this2.state.tooltip;
|
|
@@ -138,6 +141,18 @@ var PointersBar = function (_Component) {
|
|
|
138
141
|
_this2.setState(_extends({}, tooltip));
|
|
139
142
|
});
|
|
140
143
|
}
|
|
144
|
+
}, {
|
|
145
|
+
key: 'getTitle',
|
|
146
|
+
value: function getTitle(marker) {
|
|
147
|
+
var data = marker.segment_title || marker.word || '';
|
|
148
|
+
if (!data.length && marker.line1) {
|
|
149
|
+
return {
|
|
150
|
+
line1: marker.line1,
|
|
151
|
+
line2: marker.line2
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return data;
|
|
155
|
+
}
|
|
141
156
|
}, {
|
|
142
157
|
key: 'render',
|
|
143
158
|
value: function render() {
|
|
@@ -148,7 +163,7 @@ var PointersBar = function (_Component) {
|
|
|
148
163
|
isVisible = _state$tooltip.isVisible,
|
|
149
164
|
text = _state$tooltip.text,
|
|
150
165
|
left = _state$tooltip.left,
|
|
151
|
-
|
|
166
|
+
bottom = _state$tooltip.bottom;
|
|
152
167
|
|
|
153
168
|
var self = this;
|
|
154
169
|
return _react2.default.createElement(
|
|
@@ -182,7 +197,7 @@ var PointersBar = function (_Component) {
|
|
|
182
197
|
_this3.onMarkerClick(e, marker);
|
|
183
198
|
},
|
|
184
199
|
onMouseOver: function onMouseOver(e) {
|
|
185
|
-
self.setTooltipData(e, marker
|
|
200
|
+
self.setTooltipData(e, _this3.getTitle(marker));
|
|
186
201
|
},
|
|
187
202
|
onMouseOut: function onMouseOut() {
|
|
188
203
|
var tooltip = _this3.state.tooltip;
|
|
@@ -224,23 +239,12 @@ var PointersBar = function (_Component) {
|
|
|
224
239
|
width: 7,
|
|
225
240
|
height: 11
|
|
226
241
|
}),
|
|
227
|
-
_react2.default.createElement(
|
|
228
|
-
'p',
|
|
229
|
-
null,
|
|
230
|
-
'to select a range. '
|
|
231
|
-
),
|
|
232
|
-
_react2.default.createElement(
|
|
233
|
-
'p',
|
|
234
|
-
null,
|
|
235
|
-
'Then press'
|
|
236
|
-
),
|
|
237
|
-
_react2.default.createElement(_components.Icon, { name: 'add', stroke: '#fff', width: 10, height: 10 }),
|
|
238
242
|
_react2.default.createElement(
|
|
239
243
|
'p',
|
|
240
244
|
null,
|
|
241
245
|
'to create ',
|
|
242
246
|
marker_obj.name,
|
|
243
|
-
'.'
|
|
247
|
+
' in the selected range. '
|
|
244
248
|
)
|
|
245
249
|
)
|
|
246
250
|
),
|
|
@@ -255,13 +259,23 @@ var PointersBar = function (_Component) {
|
|
|
255
259
|
)
|
|
256
260
|
);
|
|
257
261
|
}) : null,
|
|
258
|
-
_react2.default.createElement(
|
|
262
|
+
text && _react2.default.createElement(
|
|
259
263
|
ToolTipStyles,
|
|
260
|
-
{ ref: this._tooltipRef, style: { left: left || 0,
|
|
264
|
+
{ multiline: !!text.line1, ref: this._tooltipRef, style: { left: left || 0, bottom: bottom || 0, visibility: isVisible ? "visible" : "hidden" } },
|
|
261
265
|
_react2.default.createElement(
|
|
262
266
|
'div',
|
|
263
267
|
{ className: 'tooltip-container' },
|
|
264
|
-
_react2.default.createElement(
|
|
268
|
+
text.line1 && _react2.default.createElement(
|
|
269
|
+
'h4',
|
|
270
|
+
null,
|
|
271
|
+
text.line1
|
|
272
|
+
),
|
|
273
|
+
text.line2 && _react2.default.createElement(
|
|
274
|
+
'h4',
|
|
275
|
+
null,
|
|
276
|
+
text.line2
|
|
277
|
+
),
|
|
278
|
+
!text.line1 && _react2.default.createElement(
|
|
265
279
|
'h4',
|
|
266
280
|
null,
|
|
267
281
|
text
|
package/components/Shortcut.js
CHANGED
|
@@ -224,11 +224,16 @@ var Shortcut = function (_Component) {
|
|
|
224
224
|
if (player.leftMarker > -1 && player.rightMarker > -1 && (!player.markerCreate || player.markerType === 'update')) {
|
|
225
225
|
onAddMarker(player.leftMarker, player.currentTime, 'update');
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
//Commented for CN-632.
|
|
228
|
+
// if (player.controlType === 'default') {
|
|
229
|
+
// onMarkerSelect(player.leftMarker, player.currentTime);
|
|
230
|
+
// }
|
|
230
231
|
}
|
|
231
232
|
}
|
|
233
|
+
if (player.leftMarker > -1 && player.currentTime > -1 && player.markerCreate) {
|
|
234
|
+
actions.handleMarkerPointChange('create');
|
|
235
|
+
onAddMarker(player.leftMarker, player.currentTime);
|
|
236
|
+
}
|
|
232
237
|
}
|
|
233
238
|
}, {
|
|
234
239
|
keyCode: 35, // End
|
|
@@ -266,16 +271,6 @@ var Shortcut = function (_Component) {
|
|
|
266
271
|
source: 'shortcut'
|
|
267
272
|
});
|
|
268
273
|
}
|
|
269
|
-
}, {
|
|
270
|
-
keyCode: 67, // C Key
|
|
271
|
-
handle: function handle(player, actions) {
|
|
272
|
-
var onAddMarker = _this.props.onAddMarker;
|
|
273
|
-
|
|
274
|
-
if (player.leftMarker > -1 && player.rightMarker > -1 && player.markerCreate) {
|
|
275
|
-
actions.handleMarkerPointChange('create');
|
|
276
|
-
onAddMarker(player.leftMarker, player.rightMarker);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
274
|
}, {
|
|
280
275
|
keyCode: 68, // D Key
|
|
281
276
|
handle: function handle(player, actions) {
|
|
@@ -463,12 +458,12 @@ var Shortcut = function (_Component) {
|
|
|
463
458
|
key: 'changePlaybackRate',
|
|
464
459
|
value: function changePlaybackRate(player, actions) {
|
|
465
460
|
var playbackRate = player.playbackRate;
|
|
466
|
-
if (playbackRate >=
|
|
467
|
-
playbackRate = 8;
|
|
468
|
-
} else if (playbackRate >= 2) {
|
|
461
|
+
if (playbackRate >= 2) {
|
|
469
462
|
playbackRate = 4;
|
|
470
|
-
} else if (playbackRate >= 1) {
|
|
463
|
+
} else if (playbackRate >= 1.5) {
|
|
471
464
|
playbackRate = 2;
|
|
465
|
+
} else if (playbackRate >= 1) {
|
|
466
|
+
playbackRate = 1.5;
|
|
472
467
|
}
|
|
473
468
|
/*
|
|
474
469
|
* else if (playbackRate >= 1.25) {
|
package/components/Video.js
CHANGED
|
@@ -112,9 +112,14 @@ var defaultProps = {
|
|
|
112
112
|
crossOrigin: 'anonymous'
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
+
var SubTitleSection = _styledComponents2.default.div.withConfig({
|
|
116
|
+
displayName: 'Video__SubTitleSection',
|
|
117
|
+
componentId: 'omlcc3-0'
|
|
118
|
+
})(['position:absolute;font-family:SFUIText-Regular;font-size:14px;bottom:20px;width:100%;display:flex;justify-content:center;text-align:center;color:#FFFFFF;height:85%;align-items:center;.subtitleContainer{border-radius:4px;width:fit-content;background:#000000;opacity:0.5;padding:8px 10px;line-height:20px;position:absolute;}']);
|
|
119
|
+
|
|
115
120
|
var VideoBlock = _styledComponents2.default.div.withConfig({
|
|
116
121
|
displayName: 'Video__VideoBlock',
|
|
117
|
-
componentId: 'omlcc3-
|
|
122
|
+
componentId: 'omlcc3-1'
|
|
118
123
|
})(['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;}}']);
|
|
119
124
|
|
|
120
125
|
var Video = function (_Component) {
|
|
@@ -140,7 +145,8 @@ var Video = function (_Component) {
|
|
|
140
145
|
'left': '0px'
|
|
141
146
|
},
|
|
142
147
|
watermarkInterval: -1,
|
|
143
|
-
isBuffering: false
|
|
148
|
+
isBuffering: false,
|
|
149
|
+
currentSubtitleObj: {}
|
|
144
150
|
};
|
|
145
151
|
_this.video = null; // the html5 video
|
|
146
152
|
_this.manager = new _Manager2.default(props.store);
|
|
@@ -414,7 +420,9 @@ var Video = function (_Component) {
|
|
|
414
420
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
415
421
|
var _props4 = this.props,
|
|
416
422
|
src = _props4.src,
|
|
417
|
-
activeAudio = _props4.player.activeAudio
|
|
423
|
+
activeAudio = _props4.player.activeAudio,
|
|
424
|
+
currentSubtitleObj = _props4.currentSubtitleObj,
|
|
425
|
+
markers = _props4.markers;
|
|
418
426
|
|
|
419
427
|
if (newProps.src !== src) {
|
|
420
428
|
var isM3U8 = this.state.isM3U8;
|
|
@@ -442,6 +450,25 @@ var Video = function (_Component) {
|
|
|
442
450
|
if (newProps.player.activeAudio && activeAudio.id !== newProps.player.activeAudio.id) {
|
|
443
451
|
this.hls.audioTrack = newProps.player.activeAudio.id;
|
|
444
452
|
}
|
|
453
|
+
if (newProps.subtitleObj && newProps.subtitleObj.field && JSON.stringify(newProps.subtitleObj) !== JSON.stringify(currentSubtitleObj)) {
|
|
454
|
+
if (newProps.subtitleObj && newProps.subtitleObj.field && !newProps.subtitleObj.field.line1) {
|
|
455
|
+
this.setState({
|
|
456
|
+
currentSubtitleObj: {}
|
|
457
|
+
});
|
|
458
|
+
} else if (newProps.subtitleObj && newProps.subtitleObj.field && newProps.subtitleObj.field.line1) {
|
|
459
|
+
var style = this.getSubtitleStyle(newProps.subtitleObj.field);
|
|
460
|
+
this.setState({
|
|
461
|
+
currentSubtitleObj: {
|
|
462
|
+
line1: newProps.subtitleObj.field.line1,
|
|
463
|
+
line2: newProps.subtitleObj.field.line2,
|
|
464
|
+
style: style
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (newProps.markers.length && markers.length && newProps.markers[0].values.length !== markers[0].values.length) {
|
|
470
|
+
this.displaySubtitle(newProps.markers);
|
|
471
|
+
}
|
|
445
472
|
}
|
|
446
473
|
|
|
447
474
|
// play the video
|
|
@@ -524,6 +551,7 @@ var Video = function (_Component) {
|
|
|
524
551
|
key: 'forward',
|
|
525
552
|
value: function forward(seconds) {
|
|
526
553
|
this.seek(this.video.currentTime + seconds);
|
|
554
|
+
this.displaySubtitle();
|
|
527
555
|
}
|
|
528
556
|
|
|
529
557
|
// jump back x seconds
|
|
@@ -532,6 +560,7 @@ var Video = function (_Component) {
|
|
|
532
560
|
key: 'replay',
|
|
533
561
|
value: function replay(seconds) {
|
|
534
562
|
this.forward(-seconds);
|
|
563
|
+
this.displaySubtitle();
|
|
535
564
|
}
|
|
536
565
|
|
|
537
566
|
// enter or exist full screen
|
|
@@ -677,6 +706,7 @@ var Video = function (_Component) {
|
|
|
677
706
|
if (onDurationChange) {
|
|
678
707
|
onDurationChange.apply(undefined, arguments);
|
|
679
708
|
}
|
|
709
|
+
this.displaySubtitle();
|
|
680
710
|
}
|
|
681
711
|
|
|
682
712
|
/*
|
|
@@ -698,6 +728,42 @@ var Video = function (_Component) {
|
|
|
698
728
|
if (onProgress) {
|
|
699
729
|
onProgress.apply(undefined, arguments);
|
|
700
730
|
}
|
|
731
|
+
this.displaySubtitle();
|
|
732
|
+
}
|
|
733
|
+
}, {
|
|
734
|
+
key: 'getSubtitleStyle',
|
|
735
|
+
value: function getSubtitleStyle(data) {
|
|
736
|
+
var style = {};
|
|
737
|
+
style.top = data && data.text_position === 'text_position_top' ? '0px' : '';
|
|
738
|
+
style.bottom = data && data.text_position === 'text_position_bottom' ? '0px' : '';
|
|
739
|
+
style.left = data && data.text_alignment === 'text_aligned_left' ? '0px' : '';
|
|
740
|
+
style.right = data && data.text_alignment === 'text_aligned_right' ? '0px' : '';
|
|
741
|
+
return style;
|
|
742
|
+
}
|
|
743
|
+
}, {
|
|
744
|
+
key: 'displaySubtitle',
|
|
745
|
+
value: function displaySubtitle(marker) {
|
|
746
|
+
var _props14 = this.props,
|
|
747
|
+
markers = _props14.markers,
|
|
748
|
+
resetSubtitleData = _props14.resetSubtitleData;
|
|
749
|
+
|
|
750
|
+
resetSubtitleData();
|
|
751
|
+
var currentTime = this.video.currentTime;
|
|
752
|
+
var currentMarker = marker || markers;
|
|
753
|
+
if (currentMarker && currentMarker[0] && currentMarker[0].name === "Subtitle") {
|
|
754
|
+
var values = currentMarker[0].values;
|
|
755
|
+
var currentValue = values.filter(function (ele) {
|
|
756
|
+
return ele.in_time <= currentTime && ele.out_time >= currentTime;
|
|
757
|
+
});
|
|
758
|
+
var style = this.getSubtitleStyle(currentValue[0]);
|
|
759
|
+
this.setState({
|
|
760
|
+
currentSubtitleObj: {
|
|
761
|
+
line1: currentValue[0] && currentValue[0].line1 || '',
|
|
762
|
+
line2: currentValue[0] && currentValue[0].line2 || '',
|
|
763
|
+
style: style
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
}
|
|
701
767
|
}
|
|
702
768
|
|
|
703
769
|
/*
|
|
@@ -708,11 +774,11 @@ var Video = function (_Component) {
|
|
|
708
774
|
}, {
|
|
709
775
|
key: 'handleEnded',
|
|
710
776
|
value: function handleEnded() {
|
|
711
|
-
var
|
|
712
|
-
loop =
|
|
713
|
-
player =
|
|
714
|
-
actions =
|
|
715
|
-
onEnded =
|
|
777
|
+
var _props15 = this.props,
|
|
778
|
+
loop = _props15.loop,
|
|
779
|
+
player = _props15.player,
|
|
780
|
+
actions = _props15.actions,
|
|
781
|
+
onEnded = _props15.onEnded;
|
|
716
782
|
|
|
717
783
|
if (loop) {
|
|
718
784
|
this.seek(0);
|
|
@@ -732,9 +798,9 @@ var Video = function (_Component) {
|
|
|
732
798
|
}, {
|
|
733
799
|
key: 'handleWaiting',
|
|
734
800
|
value: function handleWaiting() {
|
|
735
|
-
var
|
|
736
|
-
actions =
|
|
737
|
-
onWaiting =
|
|
801
|
+
var _props16 = this.props,
|
|
802
|
+
actions = _props16.actions,
|
|
803
|
+
onWaiting = _props16.onWaiting;
|
|
738
804
|
|
|
739
805
|
actions.handleWaiting(this.getProperties());
|
|
740
806
|
|
|
@@ -751,15 +817,16 @@ var Video = function (_Component) {
|
|
|
751
817
|
}, {
|
|
752
818
|
key: 'handleSeeking',
|
|
753
819
|
value: function handleSeeking() {
|
|
754
|
-
var
|
|
755
|
-
actions =
|
|
756
|
-
onSeeking =
|
|
820
|
+
var _props17 = this.props,
|
|
821
|
+
actions = _props17.actions,
|
|
822
|
+
onSeeking = _props17.onSeeking;
|
|
757
823
|
|
|
758
824
|
actions.handleSeeking(this.getProperties());
|
|
759
825
|
|
|
760
826
|
if (onSeeking) {
|
|
761
827
|
onSeeking.apply(undefined, arguments);
|
|
762
828
|
}
|
|
829
|
+
this.displaySubtitle();
|
|
763
830
|
}
|
|
764
831
|
|
|
765
832
|
/*
|
|
@@ -770,9 +837,9 @@ var Video = function (_Component) {
|
|
|
770
837
|
}, {
|
|
771
838
|
key: 'handleSeeked',
|
|
772
839
|
value: function handleSeeked() {
|
|
773
|
-
var
|
|
774
|
-
actions =
|
|
775
|
-
onSeeked =
|
|
840
|
+
var _props18 = this.props,
|
|
841
|
+
actions = _props18.actions,
|
|
842
|
+
onSeeked = _props18.onSeeked;
|
|
776
843
|
|
|
777
844
|
actions.handleSeeked(this.getProperties());
|
|
778
845
|
|
|
@@ -795,9 +862,9 @@ var Video = function (_Component) {
|
|
|
795
862
|
}, {
|
|
796
863
|
key: 'handleSuspend',
|
|
797
864
|
value: function handleSuspend() {
|
|
798
|
-
var
|
|
799
|
-
actions =
|
|
800
|
-
onSuspend =
|
|
865
|
+
var _props19 = this.props,
|
|
866
|
+
actions = _props19.actions,
|
|
867
|
+
onSuspend = _props19.onSuspend;
|
|
801
868
|
|
|
802
869
|
actions.handleSuspend(this.getProperties());
|
|
803
870
|
if (onSuspend) {
|
|
@@ -810,9 +877,9 @@ var Video = function (_Component) {
|
|
|
810
877
|
}, {
|
|
811
878
|
key: 'handleAbort',
|
|
812
879
|
value: function handleAbort() {
|
|
813
|
-
var
|
|
814
|
-
actions =
|
|
815
|
-
onAbort =
|
|
880
|
+
var _props20 = this.props,
|
|
881
|
+
actions = _props20.actions,
|
|
882
|
+
onAbort = _props20.onAbort;
|
|
816
883
|
|
|
817
884
|
actions.handleAbort(this.getProperties());
|
|
818
885
|
if (onAbort) {
|
|
@@ -825,9 +892,9 @@ var Video = function (_Component) {
|
|
|
825
892
|
}, {
|
|
826
893
|
key: 'handleEmptied',
|
|
827
894
|
value: function handleEmptied() {
|
|
828
|
-
var
|
|
829
|
-
actions =
|
|
830
|
-
onEmptied =
|
|
895
|
+
var _props21 = this.props,
|
|
896
|
+
actions = _props21.actions,
|
|
897
|
+
onEmptied = _props21.onEmptied;
|
|
831
898
|
|
|
832
899
|
actions.handleEmptied(this.getProperties());
|
|
833
900
|
if (onEmptied) {
|
|
@@ -843,9 +910,9 @@ var Video = function (_Component) {
|
|
|
843
910
|
}, {
|
|
844
911
|
key: 'handleStalled',
|
|
845
912
|
value: function handleStalled() {
|
|
846
|
-
var
|
|
847
|
-
actions =
|
|
848
|
-
onStalled =
|
|
913
|
+
var _props22 = this.props,
|
|
914
|
+
actions = _props22.actions,
|
|
915
|
+
onStalled = _props22.onStalled;
|
|
849
916
|
|
|
850
917
|
actions.handleStalled(this.getProperties());
|
|
851
918
|
|
|
@@ -862,10 +929,10 @@ var Video = function (_Component) {
|
|
|
862
929
|
}, {
|
|
863
930
|
key: 'handleLoadedMetaData',
|
|
864
931
|
value: function handleLoadedMetaData() {
|
|
865
|
-
var
|
|
866
|
-
actions =
|
|
867
|
-
onLoadedMetadata =
|
|
868
|
-
startTime =
|
|
932
|
+
var _props23 = this.props,
|
|
933
|
+
actions = _props23.actions,
|
|
934
|
+
onLoadedMetadata = _props23.onLoadedMetadata,
|
|
935
|
+
startTime = _props23.startTime;
|
|
869
936
|
|
|
870
937
|
|
|
871
938
|
if (startTime && startTime > 0) {
|
|
@@ -887,9 +954,9 @@ var Video = function (_Component) {
|
|
|
887
954
|
}, {
|
|
888
955
|
key: 'handleLoadedData',
|
|
889
956
|
value: function handleLoadedData() {
|
|
890
|
-
var
|
|
891
|
-
actions =
|
|
892
|
-
onLoadedData =
|
|
957
|
+
var _props24 = this.props,
|
|
958
|
+
actions = _props24.actions,
|
|
959
|
+
onLoadedData = _props24.onLoadedData;
|
|
893
960
|
|
|
894
961
|
actions.handleLoadedData(this.getProperties());
|
|
895
962
|
|
|
@@ -906,12 +973,12 @@ var Video = function (_Component) {
|
|
|
906
973
|
}, {
|
|
907
974
|
key: 'handleTimeUpdate',
|
|
908
975
|
value: function handleTimeUpdate() {
|
|
909
|
-
var
|
|
910
|
-
|
|
911
|
-
previewActive =
|
|
912
|
-
rightMarker =
|
|
913
|
-
actions =
|
|
914
|
-
onTimeUpdate =
|
|
976
|
+
var _props25 = this.props,
|
|
977
|
+
_props25$player = _props25.player,
|
|
978
|
+
previewActive = _props25$player.previewActive,
|
|
979
|
+
rightMarker = _props25$player.rightMarker,
|
|
980
|
+
actions = _props25.actions,
|
|
981
|
+
onTimeUpdate = _props25.onTimeUpdate;
|
|
915
982
|
|
|
916
983
|
actions.handleTimeUpdate(this.getProperties());
|
|
917
984
|
if (previewActive && this.video.currentTime >= rightMarker) {
|
|
@@ -931,9 +998,9 @@ var Video = function (_Component) {
|
|
|
931
998
|
}, {
|
|
932
999
|
key: 'handleRateChange',
|
|
933
1000
|
value: function handleRateChange() {
|
|
934
|
-
var
|
|
935
|
-
actions =
|
|
936
|
-
onRateChange =
|
|
1001
|
+
var _props26 = this.props,
|
|
1002
|
+
actions = _props26.actions,
|
|
1003
|
+
onRateChange = _props26.onRateChange;
|
|
937
1004
|
|
|
938
1005
|
actions.handleRateChange(this.getProperties());
|
|
939
1006
|
|
|
@@ -947,9 +1014,9 @@ var Video = function (_Component) {
|
|
|
947
1014
|
}, {
|
|
948
1015
|
key: 'handleVolumeChange',
|
|
949
1016
|
value: function handleVolumeChange() {
|
|
950
|
-
var
|
|
951
|
-
actions =
|
|
952
|
-
onVolumeChange =
|
|
1017
|
+
var _props27 = this.props,
|
|
1018
|
+
actions = _props27.actions,
|
|
1019
|
+
onVolumeChange = _props27.onVolumeChange;
|
|
953
1020
|
|
|
954
1021
|
actions.handleVolumeChange(this.getProperties());
|
|
955
1022
|
|
|
@@ -966,9 +1033,9 @@ var Video = function (_Component) {
|
|
|
966
1033
|
}, {
|
|
967
1034
|
key: 'handleError',
|
|
968
1035
|
value: function handleError() {
|
|
969
|
-
var
|
|
970
|
-
actions =
|
|
971
|
-
onError =
|
|
1036
|
+
var _props28 = this.props,
|
|
1037
|
+
actions = _props28.actions,
|
|
1038
|
+
onError = _props28.onError;
|
|
972
1039
|
|
|
973
1040
|
actions.handleError(this.getProperties());
|
|
974
1041
|
if (onError) {
|
|
@@ -1080,20 +1147,21 @@ var Video = function (_Component) {
|
|
|
1080
1147
|
value: function render() {
|
|
1081
1148
|
var _this5 = this;
|
|
1082
1149
|
|
|
1083
|
-
var
|
|
1084
|
-
loop =
|
|
1085
|
-
poster =
|
|
1086
|
-
preload =
|
|
1087
|
-
autoPlay =
|
|
1088
|
-
playsInline =
|
|
1089
|
-
muted =
|
|
1090
|
-
crossOrigin =
|
|
1091
|
-
videoId =
|
|
1092
|
-
fileType =
|
|
1093
|
-
userEmail =
|
|
1150
|
+
var _props29 = this.props,
|
|
1151
|
+
loop = _props29.loop,
|
|
1152
|
+
poster = _props29.poster,
|
|
1153
|
+
preload = _props29.preload,
|
|
1154
|
+
autoPlay = _props29.autoPlay,
|
|
1155
|
+
playsInline = _props29.playsInline,
|
|
1156
|
+
muted = _props29.muted,
|
|
1157
|
+
crossOrigin = _props29.crossOrigin,
|
|
1158
|
+
videoId = _props29.videoId,
|
|
1159
|
+
fileType = _props29.fileType,
|
|
1160
|
+
userEmail = _props29.userEmail;
|
|
1094
1161
|
var _state2 = this.state,
|
|
1095
1162
|
isBuffering = _state2.isBuffering,
|
|
1096
|
-
watermark = _state2.watermark
|
|
1163
|
+
watermark = _state2.watermark,
|
|
1164
|
+
currentSubtitleObj = _state2.currentSubtitleObj;
|
|
1097
1165
|
|
|
1098
1166
|
|
|
1099
1167
|
var children = this.getChildren(this.props);
|
|
@@ -1214,6 +1282,37 @@ var Video = function (_Component) {
|
|
|
1214
1282
|
'p',
|
|
1215
1283
|
{ className: 'user-name-wrapper', id: 'watermark-text', style: _extends({}, watermark) },
|
|
1216
1284
|
userEmail
|
|
1285
|
+
),
|
|
1286
|
+
currentSubtitleObj && currentSubtitleObj.line1 && currentSubtitleObj.line1.length && _react2.default.createElement(
|
|
1287
|
+
SubTitleSection,
|
|
1288
|
+
{
|
|
1289
|
+
onClick: function onClick() {
|
|
1290
|
+
if (player.paused) {
|
|
1291
|
+
actions.play();
|
|
1292
|
+
} else {
|
|
1293
|
+
actions.pause();
|
|
1294
|
+
}
|
|
1295
|
+
actions.handleVideoRewind(false);
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1298
|
+
_react2.default.createElement(
|
|
1299
|
+
'span',
|
|
1300
|
+
{ className: 'subtitleContainer', style: _extends({}, currentSubtitleObj.style) },
|
|
1301
|
+
_react2.default.createElement(
|
|
1302
|
+
'p',
|
|
1303
|
+
null,
|
|
1304
|
+
' ',
|
|
1305
|
+
currentSubtitleObj.line1,
|
|
1306
|
+
' '
|
|
1307
|
+
),
|
|
1308
|
+
_react2.default.createElement(
|
|
1309
|
+
'p',
|
|
1310
|
+
null,
|
|
1311
|
+
' ',
|
|
1312
|
+
currentSubtitleObj.line2,
|
|
1313
|
+
' '
|
|
1314
|
+
)
|
|
1315
|
+
)
|
|
1217
1316
|
)
|
|
1218
1317
|
);
|
|
1219
1318
|
}
|
|
@@ -68,6 +68,10 @@ var _MarkingControl = require('../marking-controls/MarkingControl');
|
|
|
68
68
|
|
|
69
69
|
var _MarkingControl2 = _interopRequireDefault(_MarkingControl);
|
|
70
70
|
|
|
71
|
+
var _SubtitleLanguagesMenuButton = require('./SubtitleLanguagesMenuButton');
|
|
72
|
+
|
|
73
|
+
var _SubtitleLanguagesMenuButton2 = _interopRequireDefault(_SubtitleLanguagesMenuButton);
|
|
74
|
+
|
|
71
75
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
72
76
|
|
|
73
77
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -145,6 +149,9 @@ var ControlBar = function (_Component) {
|
|
|
145
149
|
}, this.props, {
|
|
146
150
|
key: 'volume-menu-button',
|
|
147
151
|
order: 7
|
|
152
|
+
})), _react2.default.createElement(_SubtitleLanguagesMenuButton2.default, _extends({}, this.props, {
|
|
153
|
+
key: 'subtitle-menu-button',
|
|
154
|
+
order: 7
|
|
148
155
|
})), _react2.default.createElement(_AudioTracksMenuButton2.default, _extends({}, this.props, {
|
|
149
156
|
key: 'audio-tracks-menu-button',
|
|
150
157
|
order: 7
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _createClass = function () { 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
+
|
|
9
|
+
var _propTypes = require('prop-types');
|
|
10
|
+
|
|
11
|
+
var _react = require('react');
|
|
12
|
+
|
|
13
|
+
var _react2 = _interopRequireDefault(_react);
|
|
14
|
+
|
|
15
|
+
var _styledComponents = require('styled-components');
|
|
16
|
+
|
|
17
|
+
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
18
|
+
|
|
19
|
+
var _Menu = require('../Menu');
|
|
20
|
+
|
|
21
|
+
var _Menu2 = _interopRequireDefault(_Menu);
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
|
|
25
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
26
|
+
|
|
27
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
28
|
+
|
|
29
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
30
|
+
|
|
31
|
+
var propTypes = {
|
|
32
|
+
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
33
|
+
player: _propTypes.PropTypes.instanceOf(Object)
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var SubtitleMenuBlock = (0, _styledComponents2.default)('div').withConfig({
|
|
37
|
+
displayName: 'SubtitleLanguagesMenuButton__SubtitleMenuBlock',
|
|
38
|
+
componentId: 'sc-1g8hfwo-0'
|
|
39
|
+
})(['text-align:left;background:transparent;cursor:pointer;border-bottom:1px solid #eeeeee;&:last-child{border:none;}&:hover,&:focus{background:rgba(0,206,198,0.1);}p{padding 15px;font-family:SFUIText-Medium;font-size:12px;white-space:nowrap;}']);
|
|
40
|
+
|
|
41
|
+
var SubtitleLanguagesMenuButton = function (_Component) {
|
|
42
|
+
_inherits(SubtitleLanguagesMenuButton, _Component);
|
|
43
|
+
|
|
44
|
+
function SubtitleLanguagesMenuButton(props, context) {
|
|
45
|
+
_classCallCheck(this, SubtitleLanguagesMenuButton);
|
|
46
|
+
|
|
47
|
+
var _this = _possibleConstructorReturn(this, (SubtitleLanguagesMenuButton.__proto__ || Object.getPrototypeOf(SubtitleLanguagesMenuButton)).call(this, props, context));
|
|
48
|
+
|
|
49
|
+
_this.state = {
|
|
50
|
+
activeLanguage: ''
|
|
51
|
+
};
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_createClass(SubtitleLanguagesMenuButton, [{
|
|
56
|
+
key: 'changeSubtitle',
|
|
57
|
+
value: function changeSubtitle(subtitle) {
|
|
58
|
+
var filterSelectedSubtitle = this.props.filterSelectedSubtitle;
|
|
59
|
+
|
|
60
|
+
filterSelectedSubtitle(subtitle.subtitle_info_id);
|
|
61
|
+
this.setState({
|
|
62
|
+
activeLanguage: subtitle.subtitle_info_id
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: 'componentDidMount',
|
|
67
|
+
value: function componentDidMount() {
|
|
68
|
+
var subtitleData = this.props.subtitleData;
|
|
69
|
+
|
|
70
|
+
if (subtitleData && subtitleData.length) {
|
|
71
|
+
this.setState({
|
|
72
|
+
activeLanguage: subtitleData[0].subtitle_info_id
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: 'render',
|
|
78
|
+
value: function render() {
|
|
79
|
+
var _this2 = this;
|
|
80
|
+
|
|
81
|
+
var _props = this.props,
|
|
82
|
+
player = _props.player,
|
|
83
|
+
actions = _props.actions,
|
|
84
|
+
subtitleData = _props.subtitleData;
|
|
85
|
+
var activeLanguage = this.state.activeLanguage;
|
|
86
|
+
|
|
87
|
+
return _react2.default.createElement(
|
|
88
|
+
_react2.default.Fragment,
|
|
89
|
+
null,
|
|
90
|
+
subtitleData && subtitleData.length ? _react2.default.createElement(
|
|
91
|
+
_Menu2.default,
|
|
92
|
+
{
|
|
93
|
+
icon: 'subtitle',
|
|
94
|
+
player: player,
|
|
95
|
+
actions: actions,
|
|
96
|
+
style: { marginRight: '10px' },
|
|
97
|
+
position: 'left'
|
|
98
|
+
},
|
|
99
|
+
_react2.default.createElement(
|
|
100
|
+
'div',
|
|
101
|
+
{ className: 'menu-container' },
|
|
102
|
+
subtitleData.map(function (subtitle) {
|
|
103
|
+
return _react2.default.createElement(
|
|
104
|
+
SubtitleMenuBlock,
|
|
105
|
+
{
|
|
106
|
+
onClick: function onClick() {
|
|
107
|
+
return _this2.changeSubtitle(subtitle);
|
|
108
|
+
},
|
|
109
|
+
role: 'presentation',
|
|
110
|
+
key: subtitle.subtitle_info_id,
|
|
111
|
+
style: activeLanguage === subtitle.subtitle_info_id ? { pointerEvents: 'none' } : null
|
|
112
|
+
},
|
|
113
|
+
_react2.default.createElement(
|
|
114
|
+
'p',
|
|
115
|
+
{
|
|
116
|
+
style: activeLanguage === subtitle.subtitle_info_id ? { color: '#00cec6', pointerEvents: 'none' } : { color: '#333333' }
|
|
117
|
+
},
|
|
118
|
+
subtitle.title
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
})
|
|
122
|
+
)
|
|
123
|
+
) : null
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
}]);
|
|
127
|
+
|
|
128
|
+
return SubtitleLanguagesMenuButton;
|
|
129
|
+
}(_react.Component);
|
|
130
|
+
|
|
131
|
+
SubtitleLanguagesMenuButton.propTypes = propTypes;
|
|
132
|
+
SubtitleLanguagesMenuButton.displayName = 'SubtitleLanguagesMenuButton';
|
|
133
|
+
exports.default = SubtitleLanguagesMenuButton;
|
|
@@ -100,13 +100,17 @@ var MarkOutControl = function (_Component) {
|
|
|
100
100
|
actions = _props2.actions,
|
|
101
101
|
leftMarker = _props2.leftMarker,
|
|
102
102
|
controlType = _props2.controlType,
|
|
103
|
-
onMarkerSelect = _props2.onMarkerSelect
|
|
103
|
+
onMarkerSelect = _props2.onMarkerSelect,
|
|
104
|
+
onAddMarker = _props2.onAddMarker;
|
|
104
105
|
|
|
105
106
|
if (leftMarker > -1 && player.currentTime > leftMarker) {
|
|
106
107
|
actions.handleMarkerPointChange('add', 'right', player.currentTime);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
//Commented for CN-632.
|
|
109
|
+
// if (controlType === 'default') {
|
|
110
|
+
// onMarkerSelect(leftMarker, player.currentTime);
|
|
111
|
+
// }
|
|
112
|
+
actions.handleMarkerPointChange('create');
|
|
113
|
+
onAddMarker(leftMarker, player.currentTime);
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
116
|
}, {
|
|
@@ -105,7 +105,8 @@ function MarkingControl(_ref) {
|
|
|
105
105
|
markers: markers,
|
|
106
106
|
controlType: controlType,
|
|
107
107
|
onMarkerSelect: onMarkerSelect,
|
|
108
|
-
allowMarkerOverlap: allowMarkerOverlap
|
|
108
|
+
allowMarkerOverlap: allowMarkerOverlap,
|
|
109
|
+
onAddMarker: onAddMarker
|
|
109
110
|
})
|
|
110
111
|
) : null,
|
|
111
112
|
player.leftMarker > -1 || player.rightMarker > -1 ? _react2.default.createElement(_MarkingDuration2.default, {
|
|
@@ -114,16 +115,6 @@ function MarkingControl(_ref) {
|
|
|
114
115
|
frameRate: frameRate,
|
|
115
116
|
initialTime: initialTime
|
|
116
117
|
}) : null,
|
|
117
|
-
player.leftMarker > -1 && player.rightMarker > -1 && !playerReadOnlyMode && !disablePlayerActions.includes("marking_controls") ? _react2.default.createElement(
|
|
118
|
-
_react2.default.Fragment,
|
|
119
|
-
null,
|
|
120
|
-
player.markerType === 'create' && controlType === 'advanced' && player.markerCreate ? _react2.default.createElement(_MarkingAddButton2.default, {
|
|
121
|
-
leftMarker: player.leftMarker,
|
|
122
|
-
rightMarker: player.rightMarker,
|
|
123
|
-
onAddMarker: onAddMarker,
|
|
124
|
-
actions: actions
|
|
125
|
-
}) : null
|
|
126
|
-
) : null,
|
|
127
118
|
player.leftMarker > -1 && player.rightMarker > -1 ? _react2.default.createElement(_MarkingPreview2.default, {
|
|
128
119
|
actions: actions,
|
|
129
120
|
leftMarker: player.leftMarker
|
|
@@ -102,35 +102,35 @@ var PlaybackRateControl = function (_Component) {
|
|
|
102
102
|
_react2.default.createElement(
|
|
103
103
|
'div',
|
|
104
104
|
{
|
|
105
|
-
className: player.playbackRate ===
|
|
105
|
+
className: player.playbackRate === 1.5 ? 'playback-rate active' : 'playback-rate',
|
|
106
106
|
onClick: function onClick() {
|
|
107
|
-
return _this2.changePlaybackRate(
|
|
107
|
+
return _this2.changePlaybackRate(1.5);
|
|
108
108
|
},
|
|
109
109
|
role: 'presentation'
|
|
110
110
|
},
|
|
111
|
-
'
|
|
111
|
+
'1.5x'
|
|
112
112
|
),
|
|
113
113
|
_react2.default.createElement(
|
|
114
114
|
'div',
|
|
115
115
|
{
|
|
116
|
-
className: player.playbackRate ===
|
|
116
|
+
className: player.playbackRate === 2 ? 'playback-rate active' : 'playback-rate',
|
|
117
117
|
onClick: function onClick() {
|
|
118
|
-
return _this2.changePlaybackRate(
|
|
118
|
+
return _this2.changePlaybackRate(2);
|
|
119
119
|
},
|
|
120
120
|
role: 'presentation'
|
|
121
121
|
},
|
|
122
|
-
'
|
|
122
|
+
'2x'
|
|
123
123
|
),
|
|
124
124
|
_react2.default.createElement(
|
|
125
125
|
'div',
|
|
126
126
|
{
|
|
127
|
-
className: player.playbackRate ===
|
|
127
|
+
className: player.playbackRate === 4 ? 'playback-rate active' : 'playback-rate',
|
|
128
128
|
onClick: function onClick() {
|
|
129
|
-
return _this2.changePlaybackRate(
|
|
129
|
+
return _this2.changePlaybackRate(4);
|
|
130
130
|
},
|
|
131
131
|
role: 'presentation'
|
|
132
132
|
},
|
|
133
|
-
'
|
|
133
|
+
'4x'
|
|
134
134
|
)
|
|
135
135
|
)
|
|
136
136
|
);
|