@desynova-digital/player 3.7.3 → 3.7.7
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/Shortcut.js
CHANGED
|
@@ -201,8 +201,8 @@ var Shortcut = function (_Component) {
|
|
|
201
201
|
if (playerReadOnlyMode || disablePlayerActions.includes("marking_controls")) {
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
+
var createPoint = true;
|
|
204
205
|
if (playerType !== 'panel') {
|
|
205
|
-
var createPoint = true;
|
|
206
206
|
if (markers && markers.length && markers[0].values && markers[0].values.length) {
|
|
207
207
|
var markerArr = markers[0].values;
|
|
208
208
|
if (Object.keys(player.selectedMarker).length) {
|
|
@@ -230,7 +230,7 @@ var Shortcut = function (_Component) {
|
|
|
230
230
|
// }
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
if (player.leftMarker > -1 && player.currentTime > -1 && player.markerCreate) {
|
|
233
|
+
if (player.leftMarker > -1 && player.currentTime > -1 && player.markerCreate && createPoint && player.currentTime > player.leftMarker) {
|
|
234
234
|
actions.handleMarkerPointChange('create');
|
|
235
235
|
onAddMarker(player.leftMarker, player.currentTime);
|
|
236
236
|
}
|
package/components/Video.js
CHANGED
|
@@ -461,6 +461,8 @@ var Video = function (_Component) {
|
|
|
461
461
|
currentSubtitleObj: {
|
|
462
462
|
line1: newProps.subtitleObj.field.line1,
|
|
463
463
|
line2: newProps.subtitleObj.field.line2,
|
|
464
|
+
start_time: newProps.subtitleObj.field.in_time,
|
|
465
|
+
end_time: newProps.subtitleObj.field.out_time,
|
|
464
466
|
style: style
|
|
465
467
|
}
|
|
466
468
|
});
|
|
@@ -469,6 +471,9 @@ var Video = function (_Component) {
|
|
|
469
471
|
if (newProps.markers.length && markers.length && newProps.markers[0].values.length !== markers[0].values.length) {
|
|
470
472
|
this.displaySubtitle(newProps.markers);
|
|
471
473
|
}
|
|
474
|
+
if (newProps.subtitleReadOnly && newProps.subtitleDataList) {
|
|
475
|
+
this.displaySubtitle(newProps.subtitleDataList);
|
|
476
|
+
}
|
|
472
477
|
}
|
|
473
478
|
|
|
474
479
|
// play the video
|
|
@@ -741,26 +746,40 @@ var Video = function (_Component) {
|
|
|
741
746
|
value: function displaySubtitle(marker) {
|
|
742
747
|
var _props14 = this.props,
|
|
743
748
|
markers = _props14.markers,
|
|
744
|
-
resetSubtitleData = _props14.resetSubtitleData
|
|
749
|
+
resetSubtitleData = _props14.resetSubtitleData,
|
|
750
|
+
subtitleReadOnly = _props14.subtitleReadOnly,
|
|
751
|
+
subtitleDataList = _props14.subtitleDataList;
|
|
752
|
+
var currentSubtitleObj = this.state.currentSubtitleObj;
|
|
745
753
|
|
|
746
754
|
if (resetSubtitleData) {
|
|
747
755
|
resetSubtitleData();
|
|
748
756
|
}
|
|
749
757
|
var currentTime = this.video.currentTime;
|
|
750
758
|
var currentMarker = marker || markers;
|
|
759
|
+
if (subtitleReadOnly) {
|
|
760
|
+
currentMarker = marker || subtitleDataList;
|
|
761
|
+
}
|
|
751
762
|
if (currentMarker && currentMarker[0] && currentMarker[0].name === "Subtitle") {
|
|
752
763
|
var values = currentMarker[0].values;
|
|
753
764
|
var currentValue = values.filter(function (ele) {
|
|
754
765
|
return ele.start_time <= currentTime && ele.end_time >= currentTime;
|
|
755
766
|
});
|
|
756
767
|
var style = this.getSubtitleStyle(currentValue[0]);
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
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) {
|
|
771
|
+
return;
|
|
772
|
+
} else {
|
|
773
|
+
this.setState({
|
|
774
|
+
currentSubtitleObj: {
|
|
775
|
+
line1: currentValue[0] && currentValue[0].line1 || '',
|
|
776
|
+
line2: currentValue[0] && currentValue[0].line2 || '',
|
|
777
|
+
start_time: currentValue[0] && currentValue[0].start_time || '',
|
|
778
|
+
end_time: currentValue[0] && currentValue[0].end_time || '',
|
|
779
|
+
style: style
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
}
|
|
764
783
|
}
|
|
765
784
|
}
|
|
766
785
|
|
|
@@ -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
|
})
|
package/package.json
CHANGED