@desynova-digital/player 3.9.8 → 3.9.10
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 +1 -59
- package/components/Shortcut.js +4 -4
- package/components/Video.js +4 -1
- package/package.json +1 -1
package/components/Player.js
CHANGED
|
@@ -221,62 +221,6 @@ var Player = /*#__PURE__*/function (_Component) {
|
|
|
221
221
|
* this.actions.toggleFullscreen(player);
|
|
222
222
|
*/
|
|
223
223
|
}
|
|
224
|
-
|
|
225
|
-
// shouldComponentUpdate(nextProps) {
|
|
226
|
-
// // Rendering the component only if passed props value is changed
|
|
227
|
-
|
|
228
|
-
// const replacerFunc = () => {
|
|
229
|
-
// const visited = new WeakSet();
|
|
230
|
-
// return (key, value) => {
|
|
231
|
-
// if (typeof value === 'object' && value !== null) {
|
|
232
|
-
// if (visited.has(value)) {
|
|
233
|
-
// return;
|
|
234
|
-
// }
|
|
235
|
-
// visited.add(value);
|
|
236
|
-
// }
|
|
237
|
-
// return value;
|
|
238
|
-
// };
|
|
239
|
-
// };
|
|
240
|
-
|
|
241
|
-
// if ( JSON.stringify(nextProps, replacerFunc()) !== JSON.stringify(this.props, replacerFunc()) ) {
|
|
242
|
-
// return true;
|
|
243
|
-
// } else {
|
|
244
|
-
// return false;
|
|
245
|
-
// }
|
|
246
|
-
// }
|
|
247
|
-
}, {
|
|
248
|
-
key: "shouldComponentUpdate",
|
|
249
|
-
value:
|
|
250
|
-
// shouldComponentUpdate(nextProps) {
|
|
251
|
-
// // Rendering the component only if
|
|
252
|
-
// // passed props value is changed
|
|
253
|
-
|
|
254
|
-
// const replacerFunc = () => {
|
|
255
|
-
// const visited = new WeakSet();
|
|
256
|
-
// return (key, value) => {
|
|
257
|
-
// if (typeof value === "object" && value !== null) {
|
|
258
|
-
// if (visited.has(value)) {
|
|
259
|
-
// return;
|
|
260
|
-
// }
|
|
261
|
-
// visited.add(value);
|
|
262
|
-
// }
|
|
263
|
-
// return value;
|
|
264
|
-
// };
|
|
265
|
-
// };
|
|
266
|
-
|
|
267
|
-
// if ( JSON.stringify(nextProps, replacerFunc()) !== JSON.stringify(this.props, replacerFunc()) ) {
|
|
268
|
-
// return true;
|
|
269
|
-
// } else {
|
|
270
|
-
// return false;
|
|
271
|
-
// }
|
|
272
|
-
// }
|
|
273
|
-
|
|
274
|
-
function shouldComponentUpdate(nextProps, nextState) {
|
|
275
|
-
if (_.isEqual(nextProps.markers, this.props.markers)) {
|
|
276
|
-
return false;
|
|
277
|
-
}
|
|
278
|
-
return true;
|
|
279
|
-
}
|
|
280
224
|
}, {
|
|
281
225
|
key: "componentDidUpdate",
|
|
282
226
|
value: function componentDidUpdate() {
|
|
@@ -652,7 +596,7 @@ var Player = /*#__PURE__*/function (_Component) {
|
|
|
652
596
|
video.style.margin = '0 auto';
|
|
653
597
|
video.classList.add('ratio-border');
|
|
654
598
|
}
|
|
655
|
-
// this.video.handleResize();
|
|
599
|
+
// this.video.handleResize();
|
|
656
600
|
}
|
|
657
601
|
}, {
|
|
658
602
|
key: "handleFullScreenChange",
|
|
@@ -683,8 +627,6 @@ var Player = /*#__PURE__*/function (_Component) {
|
|
|
683
627
|
var _this5 = this;
|
|
684
628
|
var _this$manager$getStat2 = this.manager.getState(),
|
|
685
629
|
player = _this$manager$getStat2.player;
|
|
686
|
-
// console.log("justttttttttttt");
|
|
687
|
-
|
|
688
630
|
var props = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
689
631
|
player: player,
|
|
690
632
|
actions: this.actions,
|
package/components/Shortcut.js
CHANGED
|
@@ -199,12 +199,12 @@ var Shortcut = /*#__PURE__*/function (_Component) {
|
|
|
199
199
|
// player.currentTime
|
|
200
200
|
// );
|
|
201
201
|
var data = {
|
|
202
|
-
markerType: playerSelectedMarker.
|
|
202
|
+
markerType: playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length ? 'update' : 'add',
|
|
203
203
|
markerPos: 'left',
|
|
204
204
|
currentTime: player.currentTime
|
|
205
205
|
};
|
|
206
206
|
onAddMarker(player.currentTime, -1, '', true, data);
|
|
207
|
-
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update')) {
|
|
207
|
+
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length)) {
|
|
208
208
|
onAddMarker(player.currentTime, playerSelectedMarker.rightMarker, 'update');
|
|
209
209
|
}
|
|
210
210
|
}
|
|
@@ -251,11 +251,11 @@ var Shortcut = /*#__PURE__*/function (_Component) {
|
|
|
251
251
|
// currentTime: player.currentTime
|
|
252
252
|
// );
|
|
253
253
|
var data = {
|
|
254
|
-
markerType: playerSelectedMarker.
|
|
254
|
+
markerType: playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length ? 'update' : 'add',
|
|
255
255
|
markerPos: 'right',
|
|
256
256
|
currentTime: player.currentTime
|
|
257
257
|
};
|
|
258
|
-
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update')) {
|
|
258
|
+
if (playerSelectedMarker.leftMarker > -1 && playerSelectedMarker.rightMarker > -1 && (!playerSelectedMarker.markerCreate || playerSelectedMarker.markerType === 'update' || playerSelectedMarker.data && Object.keys(playerSelectedMarker.data).length)) {
|
|
259
259
|
onAddMarker(playerSelectedMarker.leftMarker, player.currentTime, 'update', false, data);
|
|
260
260
|
}
|
|
261
261
|
//Commented for CN-632.
|
package/components/Video.js
CHANGED
|
@@ -95,7 +95,9 @@ var defaultProps = {
|
|
|
95
95
|
aspectRatio: 'auto',
|
|
96
96
|
crossOrigin: 'anonymous'
|
|
97
97
|
};
|
|
98
|
-
var SubTitleSection = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n font-family: SFUIText-Regular;\n font-size: 16px;\n bottom: 20px;\n width: 100%;\n display: flex;\n justify-content: center;\n text-align: center;\n color: #FFFFFF;\n height: 90%;\n align-items: center;\n \n .subtitleContainer{\n border-radius: 4px;\n width: fit-content;\n background: #000000;\n opacity: 0.9;\n padding:
|
|
98
|
+
var SubTitleSection = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n font-family: SFUIText-Regular;\n font-size: 16px;\n bottom: 20px;\n width: 100%;\n display: flex;\n justify-content: center;\n text-align: center;\n color: #FFFFFF;\n height: 90%;\n align-items: center;\n \n .subtitleContainer{\n border-radius: 4px;\n width: fit-content;\n background: #000000;\n opacity: 0.9;\n padding: ", ";\n line-height: 20px;\n position: absolute;\n }\n"])), function (props) {
|
|
99
|
+
return props.currentSubtitleObj && props.currentSubtitleObj.line1 ? '8px 10px' : '0px';
|
|
100
|
+
});
|
|
99
101
|
var VideoBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n &.video-react-player-block {\n position: relative;\n transition: all 0.1s ease-in-out;\n -moz-transition: all 0.1s ease-in-out;\n -webkit-transition: all 0.1s ease-in-out;\n -ms-transition: all 0.1s ease-in-out;\n -o-transition: all 0.1s ease-in-out;\n video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n right: 0;\n bottom: 0;\n }\n .audio-tracks {\n position: relative;\n display: flex;\n background: rgba(0, 0, 0, 0.5);\n color: #fff;\n z-index: 10;\n position: absolute;\n width: 100%;\n bottom: 0;\n p {\n cursor: pointer;\n padding: 10px;\n }\n }\n .loader-container {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n z-index: 10;\n background: rgba(0,0,0,0.5)\n }\n }\n &.ratio-border {\n border: 1px solid rgba(255, 255, 255, 0.5);\n &:after {\n content: '16:9 Safe Area';\n position: absolute;\n color: #fff;\n font-family: SFUIText-Regular;\n font-size: 12px;\n transform: rotate(-90deg);\n top: 20%;\n left: -50px;\n }\n }\n"])));
|
|
100
102
|
var Video = /*#__PURE__*/function (_Component) {
|
|
101
103
|
_inherits(Video, _Component);
|
|
@@ -1231,6 +1233,7 @@ var Video = /*#__PURE__*/function (_Component) {
|
|
|
1231
1233
|
style: _objectSpread({}, watermark)
|
|
1232
1234
|
}, userEmail), /*#__PURE__*/_react["default"].createElement(SubTitleSection, {
|
|
1233
1235
|
id: "outer",
|
|
1236
|
+
currentSubtitleObj: currentSubtitleObj,
|
|
1234
1237
|
onClick: function onClick() {
|
|
1235
1238
|
return _this5.handleSubtitleContainerClick();
|
|
1236
1239
|
}
|