@desynova-digital/player 4.0.97 → 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');
@@ -236,7 +236,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
236
236
  var newHeight;
237
237
  var isFS = _fullscreen["default"].isFullscreen;
238
238
  _this.actions.handleFullscreenChange(isFS);
239
- if (isFS) {
239
+ if (isFS && rightSectionRef) {
240
240
  rightSectionRef.style.position = 'relative';
241
241
  newHeight = totalHeight - headerHeight;
242
242
  rightSectionRef.style.top = "".concat(headerHeight, "px");
@@ -850,7 +850,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
850
850
  video.classList.add('ratio-border');
851
851
  }
852
852
  // Fullscreen mode with right section consideration
853
- else if (player.isFullscreen) {
853
+ else if (player.isFullscreen && rightSectionRef) {
854
854
  // Calculate available width considering right section
855
855
  var availableWidth = totalWidth;
856
856
  if (isRightMenuVisible) {
@@ -871,6 +871,7 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
871
871
  video.style.margin = '0 auto';
872
872
  video.classList.add('ratio-border');
873
873
  } else if (window.innerHeight < 1024 && (playerContainer.offsetHeight > window.innerHeight || window.innerHeight > playerContainer.offsetHeight)) {
874
+ var _this$props6;
874
875
  var playlistMinHeight = 150;
875
876
  if (controlType === 'default') {
876
877
  if (fileType === 'image') {
@@ -888,7 +889,10 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
888
889
  }
889
890
  video.style.paddingTop = '0';
890
891
  video.style.width = videoWidth + 'px';
891
- 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
+ ;
892
896
  video.style.margin = '0 auto';
893
897
  video.classList.add('ratio-border');
894
898
  } else if (window.innerHeight >= 900) {
@@ -956,12 +960,12 @@ var Player = exports["default"] = /*#__PURE__*/function (_Component) {
956
960
  video: this.video ? this.video.video : null
957
961
  });
958
962
  var childrensLeft = this.getChildren(props, 'left');
959
- var _this$props6 = this.props,
960
- rightSection = _this$props6.rightSection,
961
- playerType = _this$props6.playerType,
962
- isFullscreen = _this$props6.isFullscreen,
963
- tabMetadata = _this$props6.tabMetadata,
964
- 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;
965
969
  return /*#__PURE__*/_react["default"].createElement(PlayerBlock, {
966
970
  ref: function ref(c) {
967
971
  _this5.manager.rootElement = c;
@@ -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.97",
3
+ "version": "4.0.98",
4
4
  "description": "Video Player Package for Contido Application",
5
5
  "main": "index.js",
6
6
  "scripts": {