@desynova-digital/player 4.0.96 → 4.0.98

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/actions/player.js CHANGED
@@ -301,11 +301,12 @@ function toggleFullscreen(player) {
301
301
  // }
302
302
 
303
303
  function toggleRightBar(player, showRightMenu) {
304
+ var _right$offsetWidth;
304
305
  var root = document.querySelector('.player-container');
305
306
  var right = document.querySelector('.right-video-section');
306
- var sidebarWidth = right.offsetWidth; // actual width of sidebar
307
+ var sidebarWidth = (_right$offsetWidth = right === null || right === void 0 ? void 0 : right.offsetWidth) !== null && _right$offsetWidth !== void 0 ? _right$offsetWidth : 0; // actual width of sidebar
307
308
  // Already fullscreen → toggle UI only (NO EXIT)
308
- if (_fullscreen["default"].isFullscreen) {
309
+ if (_fullscreen["default"].isFullscreen && right) {
309
310
  right.style.transition = 'transform 0.4s ease, opacity 0.3s ease';
310
311
  if (showRightMenu) {
311
312
  root.classList.add('rightbar-visible');
@@ -40,9 +40,7 @@ var propTypes = {
40
40
  var defaultProps = {
41
41
  height: 0
42
42
  };
43
- var RangeBlock = (0, _styledComponents["default"])('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n right: -12px;\n background-color: ", ";\n height: 100%;\n overflow: hidden;\n .range {\n color: #aaaaaa;\n font-family: SFUIText-Medium;\n text-align: right;\n font-size: 8px;\n box-sizing: border-box;\n }\n"])), function (props) {
44
- return props.isFullscreen ? '#000' : 'unset';
45
- });
43
+ var RangeBlock = (0, _styledComponents["default"])('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n right: -12px;\n height: 100%;\n overflow: hidden;\n .range {\n color: #aaaaaa;\n font-family: SFUIText-Medium;\n text-align: right;\n font-size: 8px;\n box-sizing: border-box;\n }\n"])));
46
44
  var MeterBlock = (0, _styledComponents["default"])('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n .track-block {\n position: relative;\n width: 15px;\n height: 100%;\n overflow: visible;\n &.left-track,\n &.right-track {\n &:after {\n position: absolute;\n color: #aaaaaa;\n bottom: -12px;\n font-size: 10px;\n left: 50%;\n transform: translateX(-50%);\n font-family: SFUIText-Regular;\n }\n }\n &.left-track:after {\n content: 'L';\n }\n &.right-track:after {\n content: 'R';\n }\n }\n"])));
47
45
  var ColorMeter = (0, _styledComponents["default"])('div')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n background: linear-gradient(\n to top,\n #00c8e7,\n #00e6b9 57%,\n #ff8d29 83%,\n #f6462c\n );\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1;\n .stack-block {\n height: 2px;\n margin-bottom: 3px;\n background: #000000;\n }\n"])));
48
46
  var BlackMeter = (0, _styledComponents["default"])('div')(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n background: #000000;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1;\n height: 100%;\n transition: all 0.25s ease-in-out;\n -moz-transition: all 0.25s ease-in-out;\n -webkit-transition: all 0.25s ease-in-out;\n -ms-transition: all 0.25s ease-in-out;\n -o-transition: all 0.25s ease-in-out;\n .stack-block {\n height: 2px;\n margin-bottom: 3px;\n background: #304153;\n }\n"])));
@@ -308,10 +306,7 @@ var AudioMeter = exports["default"] = /*#__PURE__*/function (_Component) {
308
306
  rangeArray = _this$state.rangeArray,
309
307
  unitBlockHeight = _this$state.unitBlockHeight,
310
308
  audioPan = _this$state.audioPan;
311
- var isFullscreen = this.props.isFullscreen;
312
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(RangeBlock, {
313
- isFullscreen: isFullscreen
314
- }, rangeArray.map(function (range) {
309
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(RangeBlock, null, rangeArray.map(function (range) {
315
310
  return /*#__PURE__*/_react["default"].createElement("div", {
316
311
  key: 'range' + range,
317
312
  style: {
@@ -158,7 +158,7 @@ var defaultProps = {
158
158
  onVolumeChange: null
159
159
  };
160
160
  var PlayerBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n"])));
161
- var PlayerContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\n// .rightbar-visible .right-video-section {\n// display: block !important;\n// }\n\n.fullscreen-left-only .right-video-section {\n display: none !important;\n}\n\n.fullscreen-left-only .left-video-section {\n display: block !important;\n}\n &.fullscreen-left-only {\n .right-video-section {\n display: none !important;\n }\n .left-video-section {\n width: 100% !important;\n }\n}\n display: flex;\n justify-content: flex-start;\n background: #000000;\n height: ", ";\n .left-video-section {\n width: ", ";\n position: relative;\n height: ", ";\n }\n .audio-meter-block {\n position: relative;\n width: 0px;\n display: none;\n &.qc {\n width: 70px;\n display: block;\n }\n }\n .right-video-section {\n position: relative;\n width: ", ";\n"])), function (props) {
161
+ var PlayerContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n.fullscreen-left-only .right-video-section {\n display: none !important;\n}\n\n.fullscreen-left-only .left-video-section {\n display: block !important;\n}\n &.fullscreen-left-only {\n .right-video-section {\n display: none !important;\n }\n .left-video-section {\n width: 100% !important;\n }\n}\n display: flex;\n justify-content: flex-start;\n background: #000000;\n height: ", ";\n .left-video-section {\n width: ", ";\n position: relative;\n height: ", ";\n }\n .audio-meter-block {\n position: relative;\n width: 0px;\n display: none;\n &.qc {\n width: 70px;\n display: block;\n }\n }\n .right-video-section {\n position: relative;\n width: ", ";\n"])), function (props) {
162
162
  return props.noRightComponent && "calc(100% - 1px) !important;";
163
163
  }, function (props) {
164
164
  if (!props.isRightMenuVisible) {
@@ -172,9 +172,7 @@ var PlayerContainer = _styledComponents["default"].div(_templateObject2 || (_tem
172
172
  }, function (props) {
173
173
  return props.noRightComponent && '100%';
174
174
  }, function (props) {
175
- if (props.isFullscreen && props.playerType === 'qc') {
176
- return 'calc(38.1% - 70px)';
177
- } else if (props.playerType === 'qc') {
175
+ if (props.playerType === 'qc') {
178
176
  return 'calc(36.33% - 70px)';
179
177
  } else {
180
178
  return '36.33%';
@@ -238,7 +236,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
238
236
  var newHeight;
239
237
  var isFS = _fullscreen["default"].isFullscreen;
240
238
  _this.actions.handleFullscreenChange(isFS);
241
- if (isFS) {
239
+ if (isFS && rightSectionRef) {
242
240
  rightSectionRef.style.position = 'relative';
243
241
  newHeight = totalHeight - headerHeight;
244
242
  rightSectionRef.style.top = "".concat(headerHeight, "px");
@@ -481,6 +479,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
481
479
  key: "progress-control",
482
480
  order: 3
483
481
  })), /*#__PURE__*/_react["default"].createElement(_RenderCommentMarkers["default"], _extends({
482
+ key: "comment-markers-".concat(isRightMenuVisible),
484
483
  isRightMenuVisible: isRightMenuVisible,
485
484
  fullScreenRef: this.props.fullScreenRef,
486
485
  duration: fullProps === null || fullProps === void 0 || (_fullProps$player = fullProps.player) === null || _fullProps$player === void 0 ? void 0 : _fullProps$player.duration,
@@ -851,7 +850,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
851
850
  video.classList.add('ratio-border');
852
851
  }
853
852
  // Fullscreen mode with right section consideration
854
- else if (player.isFullscreen) {
853
+ else if (player.isFullscreen && rightSectionRef) {
855
854
  // Calculate available width considering right section
856
855
  var availableWidth = totalWidth;
857
856
  if (isRightMenuVisible) {
@@ -872,6 +871,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
872
871
  video.style.margin = '0 auto';
873
872
  video.classList.add('ratio-border');
874
873
  } else if (window.innerHeight < 1024 && (playerContainer.offsetHeight > window.innerHeight || window.innerHeight > playerContainer.offsetHeight)) {
874
+ var _this$props6;
875
875
  var playlistMinHeight = 150;
876
876
  if (controlType === 'default') {
877
877
  if (fileType === 'image') {
@@ -889,7 +889,10 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
889
889
  }
890
890
  video.style.paddingTop = '0';
891
891
  video.style.width = videoWidth + 'px';
892
- video.style.height = videoHeight + 'px';
892
+ if (!((_this$props6 = this.props) !== null && _this$props6 !== void 0 && _this$props6.noRightComponent)) {
893
+ video.style.height = videoHeight + 'px';
894
+ }
895
+ ;
893
896
  video.style.margin = '0 auto';
894
897
  video.classList.add('ratio-border');
895
898
  } else if (window.innerHeight >= 900) {
@@ -915,6 +918,10 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
915
918
  var newH = Math.max(videoHeight - reduceBy, 0);
916
919
  video.style.height = newH + 'px';
917
920
  }
921
+ if (isRightMenuVisible && playerType === 'qc' && audioMeterBlock && player.isFullscreen) {
922
+ var widths = totalWidth - audioMeterBlock.offsetWidth - rightSectionRef.offsetWidth;
923
+ video.style.width = widths + 'px';
924
+ }
918
925
  // this.video.handleResize();
919
926
  }
920
927
  }, {
@@ -942,8 +949,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
942
949
  key: "render",
943
950
  value: function render() {
944
951
  var _this5 = this,
945
- _props$player,
946
- _props$player2;
952
+ _props$player;
947
953
  var _this$manager$getStat4 = this.manager.getState(),
948
954
  player = _this$manager$getStat4.player;
949
955
  var props = _objectSpread(_objectSpread({}, this.props), {}, {
@@ -954,12 +960,12 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
954
960
  video: this.video ? this.video.video : null
955
961
  });
956
962
  var childrensLeft = this.getChildren(props, 'left');
957
- var _this$props6 = this.props,
958
- rightSection = _this$props6.rightSection,
959
- playerType = _this$props6.playerType,
960
- isFullscreen = _this$props6.isFullscreen,
961
- tabMetadata = _this$props6.tabMetadata,
962
- isRightMenuVisible = _this$props6.isRightMenuVisible;
963
+ var _this$props7 = this.props,
964
+ rightSection = _this$props7.rightSection,
965
+ playerType = _this$props7.playerType,
966
+ isFullscreen = _this$props7.isFullscreen,
967
+ tabMetadata = _this$props7.tabMetadata,
968
+ isRightMenuVisible = _this$props7.isRightMenuVisible;
963
969
  return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
964
970
  ref: function ref(c) {
965
971
  _this5.manager.rootElement = c;
@@ -969,7 +975,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
969
975
  onBlur: this.handleBlur,
970
976
  tabIndex: "-1"
971
977
  }, /*#__PURE__*/_react["default"].createElement(PlayerContainer, _extends({
972
- className: "player-container",
978
+ className: "player-container ".concat(isFullscreen ? 'fullscreen-left-only' : ''),
973
979
  ref: function ref(playerContainer) {
974
980
  _this5._playerContainer = playerContainer;
975
981
  }
@@ -995,8 +1001,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
995
1001
  active: true
996
1002
  }, /*#__PURE__*/_react["default"].createElement(_AudioMeter["default"], {
997
1003
  player: props.player,
998
- height: this.meterHeight,
999
- isFullscreen: (_props$player2 = props.player) === null || _props$player2 === void 0 ? void 0 : _props$player2.isFullscreen
1004
+ height: this.meterHeight
1000
1005
  }))), rightSection ? /*#__PURE__*/_react["default"].createElement("div", {
1001
1006
  className: "right-video-section",
1002
1007
  ref: function ref(rightSectionRef) {
@@ -225,7 +225,8 @@ var PlayerHeader = exports["default"] = /*#__PURE__*/function (_Component) {
225
225
  openSharePopup = _this$props6.openSharePopup,
226
226
  isShareAvailable = _this$props6.isShareAvailable,
227
227
  isUserGuest = _this$props6.isUserGuest,
228
- isRightMenuVisible = _this$props6.isRightMenuVisible;
228
+ isRightMenuVisible = _this$props6.isRightMenuVisible,
229
+ noRightComponent = _this$props6.noRightComponent;
229
230
  var _this$state = this.state,
230
231
  versionIndex = _this$state.versionIndex,
231
232
  updatedVersionsList = _this$state.updatedVersionsList;
@@ -367,7 +368,7 @@ var PlayerHeader = exports["default"] = /*#__PURE__*/function (_Component) {
367
368
  style: {
368
369
  pointerEvents: 'none'
369
370
  }
370
- }, this.props)) : null, isFullscreen ? /*#__PURE__*/_react["default"].createElement(IconButton, {
371
+ }, this.props)) : null, isFullscreen && !noRightComponent ? /*#__PURE__*/_react["default"].createElement(IconButton, {
371
372
  isRightMenuVisible: isRightMenuVisible,
372
373
  display: "rounded",
373
374
  appearance: "cta",
@@ -27,7 +27,8 @@ var _SubtitleMovementMenu = _interopRequireDefault(require("./SubtitleMovementMe
27
27
  var _ZoomMenuButton = _interopRequireDefault(require("./ZoomMenuButton"));
28
28
  var _colors = _interopRequireDefault(require("../../colors"));
29
29
  var _TimecodeFormatSelector = _interopRequireDefault(require("../marking-controls/TimecodeFormatSelector"));
30
- var _templateObject, _templateObject2; // import CommentsButton from './CommentsButton';
30
+ var _components = require("@desynova-digital/components");
31
+ var _templateObject, _templateObject2, _templateObject3; // import CommentsButton from './CommentsButton';
31
32
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
32
33
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
33
34
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
@@ -65,6 +66,7 @@ var PlayerControlBlock = _styledComponents["default"].div(_templateObject || (_t
65
66
  return props.player === 'panel' ? '0px' : 'initial';
66
67
  }, _colors["default"].common.base.black);
67
68
  var VideoControlBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n"])));
69
+ var DownloadButton = (0, _styledComponents["default"])(_components.Button)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n margin: 0px;\n &:hover,\n &:focus {\n background: transparent;\n }\n"])));
68
70
  var defaultProps = {
69
71
  autoHide: false,
70
72
  className: ''
@@ -82,8 +84,12 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
82
84
  return _createClass(ControlBar, [{
83
85
  key: "getDefaultChildren",
84
86
  value: function getDefaultChildren() {
85
- var playerType = this.props.playerType;
86
- return [/*#__PURE__*/_react["default"].createElement(_PlayToggle["default"], _extends({}, this.props, {
87
+ var _this$props2;
88
+ var _this$props = this.props,
89
+ playerType = _this$props.playerType,
90
+ theme = _this$props.theme,
91
+ handleShareDownload = _this$props.handleShareDownload;
92
+ var arr = [/*#__PURE__*/_react["default"].createElement(_PlayToggle["default"], _extends({}, this.props, {
87
93
  key: "play-toggle",
88
94
  order: 2
89
95
  })), /*#__PURE__*/_react["default"].createElement(_ReplayControl["default"], _extends({}, this.props, {
@@ -130,7 +136,7 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
130
136
  }
131
137
  }, this.props, {
132
138
  key: "volume-menu-button",
133
- order: 7
139
+ order: 8
134
140
  })),
135
141
  /*#__PURE__*/
136
142
  //Added to show camera button on fullscreen too
@@ -145,12 +151,12 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
145
151
  // order={7}
146
152
  // />,
147
153
  _react["default"].createElement(_CaptionControlMenuButton["default"], _extends({}, this.props, {
148
- order: 7,
154
+ order: 8,
149
155
  playerType: playerType,
150
156
  key: "caption-control-menu-button"
151
157
  })), /*#__PURE__*/_react["default"].createElement(_AudioTracksMenuButton["default"], _extends({}, this.props, {
152
158
  key: "audio-tracks-menu-button",
153
- order: 7
159
+ order: 8
154
160
  })), /*#__PURE__*/_react["default"].createElement(_SettingsMenuButton["default"], _extends({}, this.props, {
155
161
  key: "settings-menu-button",
156
162
  order: 9
@@ -161,6 +167,25 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
161
167
  marginRight: '10px'
162
168
  }
163
169
  }))];
170
+ if (this.props.noRightComponent && (_this$props2 = this.props) !== null && _this$props2 !== void 0 && (_this$props2 = _this$props2.videoData) !== null && _this$props2 !== void 0 && (_this$props2 = _this$props2.asset_actions) !== null && _this$props2 !== void 0 && _this$props2.includes('download_shared_asset')) {
171
+ arr.push(/*#__PURE__*/_react["default"].createElement(DownloadButton, {
172
+ theme: theme,
173
+ display: "rounded",
174
+ appearance: "cta",
175
+ icon: "download",
176
+ iconWidth: 18,
177
+ iconHeight: 18,
178
+ width: 20,
179
+ height: 20,
180
+ order: 9,
181
+ onClick: handleShareDownload,
182
+ key: "download-button",
183
+ style: {
184
+ marginLeft: '10px'
185
+ }
186
+ }));
187
+ }
188
+ return arr;
164
189
  }
165
190
  }, {
166
191
  key: "getAdvancedChildren",
@@ -268,11 +293,11 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
268
293
  }, {
269
294
  key: "getChildren",
270
295
  value: function getChildren() {
271
- var _this$props = this.props,
272
- controlType = _this$props.controlType,
273
- children = _this$props.children,
274
- fileType = _this$props.fileType,
275
- player = _this$props.player;
296
+ var _this$props3 = this.props,
297
+ controlType = _this$props3.controlType,
298
+ children = _this$props3.children,
299
+ fileType = _this$props3.fileType,
300
+ player = _this$props3.player;
276
301
  var childrens = _react["default"].Children.toArray(children);
277
302
  var defaultChildren = [];
278
303
  if (fileType === 'image') {
@@ -286,9 +311,9 @@ var ControlBar = exports["default"] = /*#__PURE__*/function (_Component) {
286
311
  key: "render",
287
312
  value: function render() {
288
313
  var children = this.getChildren();
289
- var _this$props2 = this.props,
290
- userActivity = _this$props2.player.userActivity,
291
- playerType = _this$props2.playerType;
314
+ var _this$props4 = this.props,
315
+ userActivity = _this$props4.player.userActivity,
316
+ playerType = _this$props4.playerType;
292
317
  return /*#__PURE__*/_react["default"].createElement(PlayerControlBlock, {
293
318
  active: userActivity,
294
319
  player: playerType
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desynova-digital/player",
3
- "version": "4.0.96",
3
+ "version": "4.0.98",
4
4
  "description": "Video Player Package for Contido Application",
5
5
  "main": "index.js",
6
6
  "scripts": {