@desynova-digital/player 3.7.4 → 3.8.0
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/Video.js +28 -9
- package/components/control-bar/ControlBar.js +3 -0
- package/components/control-bar/SubtitleLanguagesMenuButton.js +43 -2
- package/components/marking-controls/MarkingControl.js +2 -1
- package/components/progress-bar/ProgressControl.js +1 -1
- package/components/progress-bar/SeekBar.js +50 -50
- package/components/progress-bar/Timeline.js +1 -1
- package/components/zoom-control/ZoomLevel.js +3 -2
- package/package.json +1 -1
package/components/Video.js
CHANGED
|
@@ -471,6 +471,9 @@ var Video = function (_Component) {
|
|
|
471
471
|
if (newProps.markers.length && markers.length && newProps.markers[0].values.length !== markers[0].values.length) {
|
|
472
472
|
this.displaySubtitle(newProps.markers);
|
|
473
473
|
}
|
|
474
|
+
if (newProps.subtitleReadOnly && newProps.subtitleDataList) {
|
|
475
|
+
this.displaySubtitle(newProps.subtitleDataList);
|
|
476
|
+
}
|
|
474
477
|
}
|
|
475
478
|
|
|
476
479
|
// play the video
|
|
@@ -743,7 +746,9 @@ var Video = function (_Component) {
|
|
|
743
746
|
value: function displaySubtitle(marker) {
|
|
744
747
|
var _props14 = this.props,
|
|
745
748
|
markers = _props14.markers,
|
|
746
|
-
resetSubtitleData = _props14.resetSubtitleData
|
|
749
|
+
resetSubtitleData = _props14.resetSubtitleData,
|
|
750
|
+
subtitleReadOnly = _props14.subtitleReadOnly,
|
|
751
|
+
subtitleDataList = _props14.subtitleDataList;
|
|
747
752
|
var currentSubtitleObj = this.state.currentSubtitleObj;
|
|
748
753
|
|
|
749
754
|
if (resetSubtitleData) {
|
|
@@ -751,13 +756,18 @@ var Video = function (_Component) {
|
|
|
751
756
|
}
|
|
752
757
|
var currentTime = this.video.currentTime;
|
|
753
758
|
var currentMarker = marker || markers;
|
|
759
|
+
if (subtitleReadOnly) {
|
|
760
|
+
currentMarker = marker || subtitleDataList;
|
|
761
|
+
}
|
|
754
762
|
if (currentMarker && currentMarker[0] && currentMarker[0].name === "Subtitle") {
|
|
755
763
|
var values = currentMarker[0].values;
|
|
756
764
|
var currentValue = values.filter(function (ele) {
|
|
757
765
|
return ele.start_time <= currentTime && ele.end_time >= currentTime;
|
|
758
766
|
});
|
|
759
767
|
var style = this.getSubtitleStyle(currentValue[0]);
|
|
760
|
-
|
|
768
|
+
var currentLine1 = currentSubtitleObj && currentSubtitleObj.line1 || '';
|
|
769
|
+
var propsLine1 = currentValue[0] && currentValue[0].line1 || '';
|
|
770
|
+
if (currentValue && currentValue.length && (currentSubtitleObj.start_time === currentValue[0].start_time || currentSubtitleObj.end_time === currentValue[0].end_time) && currentLine1 === propsLine1 || Object.keys(currentSubtitleObj).length && currentValue.length && currentValue.length === currentSubtitleObj.start_time.length && currentValue.length === currentSubtitleObj.end_time.length && currentLine1 === propsLine1) {
|
|
761
771
|
return;
|
|
762
772
|
} else {
|
|
763
773
|
this.setState({
|
|
@@ -1150,16 +1160,25 @@ var Video = function (_Component) {
|
|
|
1150
1160
|
});
|
|
1151
1161
|
}
|
|
1152
1162
|
}, {
|
|
1153
|
-
key: '
|
|
1154
|
-
value: function
|
|
1163
|
+
key: 'handleSubtitleClick',
|
|
1164
|
+
value: function handleSubtitleClick() {
|
|
1155
1165
|
var _props29 = this.props,
|
|
1156
1166
|
actions = _props29.actions,
|
|
1157
|
-
|
|
1167
|
+
onScreenSubtitleClick = _props29.onScreenSubtitleClick,
|
|
1168
|
+
controlType = _props29.controlType;
|
|
1169
|
+
var currentSubtitleObj = this.state.currentSubtitleObj;
|
|
1158
1170
|
|
|
1159
|
-
if (
|
|
1160
|
-
|
|
1161
|
-
|
|
1171
|
+
if (controlType === 'advanced') {
|
|
1172
|
+
if (onScreenSubtitleClick) {
|
|
1173
|
+
onScreenSubtitleClick(currentSubtitleObj);
|
|
1174
|
+
}
|
|
1162
1175
|
actions.pause();
|
|
1176
|
+
} else {
|
|
1177
|
+
if (player.paused) {
|
|
1178
|
+
actions.play();
|
|
1179
|
+
} else {
|
|
1180
|
+
actions.pause();
|
|
1181
|
+
}
|
|
1163
1182
|
}
|
|
1164
1183
|
actions.handleVideoRewind(false);
|
|
1165
1184
|
}
|
|
@@ -1308,7 +1327,7 @@ var Video = function (_Component) {
|
|
|
1308
1327
|
SubTitleSection,
|
|
1309
1328
|
{
|
|
1310
1329
|
onClick: function onClick() {
|
|
1311
|
-
return _this5.
|
|
1330
|
+
return _this5.handleSubtitleClick();
|
|
1312
1331
|
}
|
|
1313
1332
|
},
|
|
1314
1333
|
_react2.default.createElement(
|
|
@@ -191,6 +191,9 @@ var ControlBar = function (_Component) {
|
|
|
191
191
|
}, this.props, {
|
|
192
192
|
key: 'volume-menu-button',
|
|
193
193
|
order: 8
|
|
194
|
+
})), _react2.default.createElement(_SubtitleLanguagesMenuButton2.default, _extends({}, this.props, {
|
|
195
|
+
key: 'subtitle-menu-button',
|
|
196
|
+
order: 8
|
|
194
197
|
})), _react2.default.createElement(_CameraButton2.default, {
|
|
195
198
|
order: 9,
|
|
196
199
|
playerType: playerType
|
|
@@ -20,6 +20,8 @@ var _Menu = require('../Menu');
|
|
|
20
20
|
|
|
21
21
|
var _Menu2 = _interopRequireDefault(_Menu);
|
|
22
22
|
|
|
23
|
+
var _components = require('@desynova-digital/components');
|
|
24
|
+
|
|
23
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
26
|
|
|
25
27
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -33,10 +35,25 @@ var propTypes = {
|
|
|
33
35
|
player: _propTypes.PropTypes.instanceOf(Object)
|
|
34
36
|
};
|
|
35
37
|
|
|
38
|
+
var IconButtonStyles = (0, _styledComponents2.default)(_components.Button).withConfig({
|
|
39
|
+
displayName: 'SubtitleLanguagesMenuButton__IconButtonStyles',
|
|
40
|
+
componentId: 'sc-1g8hfwo-0'
|
|
41
|
+
})(['border:none;pointer-events:stroke;background-color:', ';svg{path{fill:', ' !important;}}&:hover,&:focus,&:active{border:none;border-radius:', ';svg{path{fill:', ' !important;}}}'], function (props) {
|
|
42
|
+
return props.backgroundColor;
|
|
43
|
+
}, function (_ref) {
|
|
44
|
+
var svgFillDefault = _ref.svgFillDefault;
|
|
45
|
+
return svgFillDefault;
|
|
46
|
+
}, function (props) {
|
|
47
|
+
return props.borderRadius ? props.borderRadius : 'none';
|
|
48
|
+
}, function (_ref2) {
|
|
49
|
+
var hoverColor = _ref2.hoverColor;
|
|
50
|
+
return hoverColor;
|
|
51
|
+
});
|
|
52
|
+
|
|
36
53
|
var SubtitleMenuBlock = (0, _styledComponents2.default)('div').withConfig({
|
|
37
54
|
displayName: 'SubtitleLanguagesMenuButton__SubtitleMenuBlock',
|
|
38
|
-
componentId: 'sc-1g8hfwo-
|
|
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;}']);
|
|
55
|
+
componentId: 'sc-1g8hfwo-1'
|
|
56
|
+
})(['display:flex;justify-content:space-between;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;}.icon-wrapper{padding:9px;}.tooltip-container{.tooltip-block{white-space:nowrap;padding:0px;left:-15px;:after{right:0px;left:auto;}p{text-transform:capitalize;font-size:10px;padding:12px;}}}']);
|
|
40
57
|
|
|
41
58
|
var SubtitleLanguagesMenuButton = function (_Component) {
|
|
42
59
|
_inherits(SubtitleLanguagesMenuButton, _Component);
|
|
@@ -116,6 +133,30 @@ var SubtitleLanguagesMenuButton = function (_Component) {
|
|
|
116
133
|
style: activeLanguage === subtitle.subtitle_info_id ? { color: '#00cec6', pointerEvents: 'none' } : { color: '#333333' }
|
|
117
134
|
},
|
|
118
135
|
subtitle.title
|
|
136
|
+
),
|
|
137
|
+
subtitle.srt_file_name && _react2.default.createElement(
|
|
138
|
+
'div',
|
|
139
|
+
{ className: 'icon-wrapper' },
|
|
140
|
+
_react2.default.createElement(IconButtonStyles, {
|
|
141
|
+
display: 'rounded',
|
|
142
|
+
appearance: 'cta',
|
|
143
|
+
icon: 'download',
|
|
144
|
+
label: 'Download',
|
|
145
|
+
iconWidth: 14,
|
|
146
|
+
iconHeight: 14,
|
|
147
|
+
width: 22,
|
|
148
|
+
height: 22,
|
|
149
|
+
hoverColor: '#FFFFFF',
|
|
150
|
+
hoverBackgroundColor: '#00cec6',
|
|
151
|
+
backgroundColor: activeLanguage === subtitle.subtitle_info_id ? '#00cec6' : 'rgb(51,51,51,0.1)',
|
|
152
|
+
svgFillDefault: activeLanguage === subtitle.subtitle_info_id ? '#FFFFFF' : 'rgb(51,51,51)',
|
|
153
|
+
borderRadius: '50%',
|
|
154
|
+
onClick: function onClick(e) {
|
|
155
|
+
console.log("icon clicked1");
|
|
156
|
+
window.open(subtitle.srt_file_name, '_blank');
|
|
157
|
+
e.stopPropagation();
|
|
158
|
+
}
|
|
159
|
+
})
|
|
119
160
|
)
|
|
120
161
|
);
|
|
121
162
|
})
|
|
@@ -79,7 +79,8 @@ function MarkingControl(_ref) {
|
|
|
79
79
|
playerType = _ref.playerType,
|
|
80
80
|
allowMarkerOverlap = _ref.allowMarkerOverlap,
|
|
81
81
|
playerReadOnlyMode = _ref.playerReadOnlyMode,
|
|
82
|
-
|
|
82
|
+
_ref$disablePlayerAct = _ref.disablePlayerActions,
|
|
83
|
+
disablePlayerActions = _ref$disablePlayerAct === undefined ? [] : _ref$disablePlayerAct;
|
|
83
84
|
|
|
84
85
|
return _react2.default.createElement(
|
|
85
86
|
_react2.default.Fragment,
|
|
@@ -130,7 +130,7 @@ var ProgressControl = function (_Component) {
|
|
|
130
130
|
// To be Rectified
|
|
131
131
|
if (this.seekBar.timeline) {
|
|
132
132
|
this.seekBar.timeline.generateTimeline();
|
|
133
|
-
this.seekBar.audioWaveform.getWaveform();
|
|
133
|
+
// this.seekBar.audioWaveform.getWaveform();
|
|
134
134
|
this.setState({ stateZoom: zoom });
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -18,10 +18,6 @@ var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
|
18
18
|
|
|
19
19
|
var _propTypes = require('prop-types');
|
|
20
20
|
|
|
21
|
-
var _AudioWaveform = require('./AudioWaveform');
|
|
22
|
-
|
|
23
|
-
var _AudioWaveform2 = _interopRequireDefault(_AudioWaveform);
|
|
24
|
-
|
|
25
21
|
var _Slider = require('../Slider');
|
|
26
22
|
|
|
27
23
|
var _Slider2 = _interopRequireDefault(_Slider);
|
|
@@ -52,6 +48,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|
|
52
48
|
|
|
53
49
|
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; }
|
|
54
50
|
|
|
51
|
+
// import AudioWaveform from './AudioWaveform';
|
|
52
|
+
|
|
53
|
+
|
|
55
54
|
// import MouseTimeDisplay from './MouseTimeDisplay';
|
|
56
55
|
|
|
57
56
|
var AdvancedControlBlock = _styledComponents2.default.div.withConfig({
|
|
@@ -137,11 +136,13 @@ var SeekBar = function (_Component) {
|
|
|
137
136
|
}, {
|
|
138
137
|
key: 'handleMouseDown',
|
|
139
138
|
value: function handleMouseDown() {
|
|
139
|
+
console.log('handleMouse handleMouseDown');
|
|
140
140
|
this.setState({ sliderActive: true });
|
|
141
141
|
}
|
|
142
142
|
}, {
|
|
143
143
|
key: 'handleMouseUp',
|
|
144
144
|
value: function handleMouseUp(event) {
|
|
145
|
+
console.log('handleMouse handleMouseUp');
|
|
145
146
|
var actions = this.props.actions;
|
|
146
147
|
|
|
147
148
|
var newTime = this.getNewTime(event);
|
|
@@ -199,54 +200,53 @@ var SeekBar = function (_Component) {
|
|
|
199
200
|
_react2.default.createElement(_MarkerBar2.default, this.props),
|
|
200
201
|
tagsMarker && tagsMarker.length ? _react2.default.createElement(_TagsBar2.default, this.props) : null,
|
|
201
202
|
_react2.default.createElement(
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
'div',
|
|
204
|
+
{
|
|
205
|
+
onMouseDown: this.handleMouseDown,
|
|
206
|
+
onMouseMove: this.handleMouseMove,
|
|
207
|
+
onMouseUp: this.handleMouseUp
|
|
208
|
+
},
|
|
204
209
|
_react2.default.createElement(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
210
|
+
SliderBlock,
|
|
211
|
+
null,
|
|
212
|
+
_react2.default.createElement(
|
|
213
|
+
_Slider2.default,
|
|
214
|
+
{
|
|
215
|
+
ref: function ref(input) {
|
|
216
|
+
_this2.slider = input;
|
|
217
|
+
},
|
|
218
|
+
label: 'video progress bar',
|
|
219
|
+
valuenow: (this.getPercent() * 100).toFixed(2),
|
|
220
|
+
valuetext: (0, _utils.formatTime)(time, duration)
|
|
221
|
+
// onMouseDown={this.handleMouseDown}
|
|
222
|
+
// onMouseMove={this.handleMouseMove}
|
|
223
|
+
// onMouseUp={this.handleMouseUp}
|
|
224
|
+
, getPercent: this.getPercent,
|
|
225
|
+
stepForward: this.stepForward,
|
|
226
|
+
stepBack: this.stepBack
|
|
209
227
|
},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
null
|
|
231
|
-
|
|
232
|
-
AdvancedControlBlock,
|
|
233
|
-
{
|
|
234
|
-
onMouseDown: this.handleMouseDown,
|
|
235
|
-
onMouseMove: this.handleMouseMove,
|
|
236
|
-
onMouseUp: this.handleMouseUp
|
|
237
|
-
},
|
|
238
|
-
_react2.default.createElement(_AudioWaveform2.default, _extends({}, this.props, {
|
|
239
|
-
ref: function ref(c) {
|
|
240
|
-
_this2.audioWaveform = c;
|
|
241
|
-
}
|
|
242
|
-
})),
|
|
243
|
-
_react2.default.createElement(_Timeline2.default, _extends({}, this.props, {
|
|
244
|
-
ref: function ref(c) {
|
|
245
|
-
_this2.timeline = c;
|
|
246
|
-
}
|
|
247
|
-
}))
|
|
248
|
-
)
|
|
249
|
-
) : null
|
|
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
250
|
);
|
|
251
251
|
}
|
|
252
252
|
}]);
|
|
@@ -39,7 +39,7 @@ var propTypes = {
|
|
|
39
39
|
var TimelineBlock = _styledComponents2.default.div.withConfig({
|
|
40
40
|
displayName: 'Timeline__TimelineBlock',
|
|
41
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;&: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;}}'], _components.Icon.Element, _components.Icon.Element);
|
|
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
43
|
|
|
44
44
|
var Timeline = function (_Component) {
|
|
45
45
|
_inherits(Timeline, _Component);
|
|
@@ -49,7 +49,8 @@ var ZoomLevelBar = _styledComponents2.default.div.withConfig({
|
|
|
49
49
|
function ZoomLevel(_ref) {
|
|
50
50
|
var percentage = _ref.percentage,
|
|
51
51
|
vertical = _ref.vertical,
|
|
52
|
-
playerType = _ref.playerType
|
|
52
|
+
playerType = _ref.playerType,
|
|
53
|
+
assetType = _ref.assetType;
|
|
53
54
|
|
|
54
55
|
var style = {};
|
|
55
56
|
if (vertical) {
|
|
@@ -58,7 +59,7 @@ function ZoomLevel(_ref) {
|
|
|
58
59
|
style.width = percentage;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
return _react2.default.createElement(ZoomLevelBar, { style: style, playerType: playerType, vertical: vertical });
|
|
62
|
+
return _react2.default.createElement(ZoomLevelBar, { style: style, playerType: playerType, vertical: vertical, assetType: assetType });
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
ZoomLevel.propTypes = propTypes;
|