videomail-client 13.4.3 → 13.4.4

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.
@@ -10664,7 +10664,7 @@ var __webpack_exports__ = {};
10664
10664
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10665
10665
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10666
10666
  var package_namespaceObject = {
10667
- rE: "13.4.3"
10667
+ rE: "13.4.4"
10668
10668
  };
10669
10669
  var defined = __webpack_require__("./node_modules/defined/index.js");
10670
10670
  var defined_default = /*#__PURE__*/ __webpack_require__.n(defined);
@@ -16426,15 +16426,11 @@ var __webpack_exports__ = {};
16426
16426
  return ratio;
16427
16427
  }
16428
16428
  const dimensions_getRatio = getRatio;
16429
- function calculateHeight(responsive, videoWidth, options, target, ratio, element) {
16429
+ function calculateHeight(responsive, videoWidth, options, ratio, element) {
16430
16430
  const dimension = {
16431
16431
  unit: "px"
16432
16432
  };
16433
16433
  let width = videoWidth;
16434
- if (0 === width) throw error_createError({
16435
- message: `Unable to calculate height for target ${target} when width is zero, while responsive mode is set to ${responsive}`,
16436
- options
16437
- });
16438
16434
  if (responsive && element) {
16439
16435
  const limitedDimension = dimensions_limitWidth(element, options, width);
16440
16436
  width = limitedDimension.value;
@@ -17863,15 +17859,9 @@ var __webpack_exports__ = {};
17863
17859
  }
17864
17860
  calculateHeight(responsive) {
17865
17861
  let videoWidth;
17866
- let target = "(unknown)";
17867
- if (this.userMedia) {
17868
- target = "userMedia";
17869
- videoWidth = this.userMedia.getVideoWidth();
17870
- } else if (this.recorderElement) {
17871
- target = "recorderElement";
17872
- videoWidth = this.recorderElement.videoWidth || this.recorderElement.width;
17873
- }
17874
- return dimensions_calculateHeight(responsive, videoWidth, this.options, target, this.getRatio(), this.recorderElement);
17862
+ if (this.userMedia) videoWidth = this.userMedia.getVideoWidth();
17863
+ else if (this.recorderElement) videoWidth = this.recorderElement.videoWidth || this.recorderElement.width;
17864
+ return dimensions_calculateHeight(responsive, videoWidth, this.options, this.getRatio(), this.recorderElement);
17875
17865
  }
17876
17866
  getRawVisualUserMedia() {
17877
17867
  return this.recorderElement;
@@ -17946,13 +17936,8 @@ var __webpack_exports__ = {};
17946
17936
  if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
17947
17937
  if (!height) {
17948
17938
  let element = this.visuals.getElement();
17949
- let target;
17950
- if (element) target = "visualsElement";
17951
- else {
17952
- element = document.body;
17953
- target = "document body";
17954
- }
17955
- height = dimensions_calculateHeight(responsive, videoWidth, this.options, target, ratio, element);
17939
+ if (!element) element = document.body;
17940
+ height = dimensions_calculateHeight(responsive, videoWidth, this.options, ratio, element);
17956
17941
  }
17957
17942
  if (width > 0) this.replayElement.style.width = `${width}px`;
17958
17943
  else this.replayElement.style.width = "auto";
package/dist/esm/index.js CHANGED
@@ -3606,7 +3606,7 @@ const constants = {
3606
3606
  }
3607
3607
  };
3608
3608
  var package_namespaceObject = {
3609
- rE: "13.4.3"
3609
+ rE: "13.4.4"
3610
3610
  };
3611
3611
  function canPlayType_canPlayType(video, type) {
3612
3612
  const canPlayType = video.canPlayType(`video/${type}`);
@@ -5785,15 +5785,11 @@ function getRatio(options, videoHeight, videoWidth) {
5785
5785
  return ratio;
5786
5786
  }
5787
5787
  const dimensions_getRatio = getRatio;
5788
- function calculateHeight(responsive, videoWidth, options, target, ratio, element) {
5788
+ function calculateHeight(responsive, videoWidth, options, ratio, element) {
5789
5789
  const dimension = {
5790
5790
  unit: "px"
5791
5791
  };
5792
5792
  let width = videoWidth;
5793
- if (0 === width) throw error_createError({
5794
- message: `Unable to calculate height for target ${target} when width is zero, while responsive mode is set to ${responsive}`,
5795
- options
5796
- });
5797
5793
  if (responsive && element) {
5798
5794
  const limitedDimension = dimensions_limitWidth(element, options, width);
5799
5795
  width = limitedDimension.value;
@@ -7194,15 +7190,9 @@ class Recorder extends util_Despot {
7194
7190
  }
7195
7191
  calculateHeight(responsive) {
7196
7192
  let videoWidth;
7197
- let target = "(unknown)";
7198
- if (this.userMedia) {
7199
- target = "userMedia";
7200
- videoWidth = this.userMedia.getVideoWidth();
7201
- } else if (this.recorderElement) {
7202
- target = "recorderElement";
7203
- videoWidth = this.recorderElement.videoWidth || this.recorderElement.width;
7204
- }
7205
- return dimensions_calculateHeight(responsive, videoWidth, this.options, target, this.getRatio(), this.recorderElement);
7193
+ if (this.userMedia) videoWidth = this.userMedia.getVideoWidth();
7194
+ else if (this.recorderElement) videoWidth = this.recorderElement.videoWidth || this.recorderElement.width;
7195
+ return dimensions_calculateHeight(responsive, videoWidth, this.options, this.getRatio(), this.recorderElement);
7206
7196
  }
7207
7197
  getRawVisualUserMedia() {
7208
7198
  return this.recorderElement;
@@ -7268,13 +7258,8 @@ class Replay extends util_Despot {
7268
7258
  if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
7269
7259
  if (!height) {
7270
7260
  let element = this.visuals.getElement();
7271
- let target;
7272
- if (element) target = "visualsElement";
7273
- else {
7274
- element = document.body;
7275
- target = "document body";
7276
- }
7277
- height = dimensions_calculateHeight(responsive, videoWidth, this.options, target, ratio, element);
7261
+ if (!element) element = document.body;
7262
+ height = dimensions_calculateHeight(responsive, videoWidth, this.options, ratio, element);
7278
7263
  }
7279
7264
  if (width > 0) this.replayElement.style.width = `${width}px`;
7280
7265
  else this.replayElement.style.width = "auto";
@@ -1,4 +1,4 @@
1
1
  import { Dimension } from "../../../types/dimension";
2
2
  import { VideomailClientOptions } from "../../../types/options";
3
- declare function calculateHeight(responsive: boolean, videoWidth: number | undefined, options: VideomailClientOptions, target: string, ratio?: number, element?: HTMLElement | null): Dimension;
3
+ declare function calculateHeight(responsive: boolean, videoWidth: number | undefined, options: VideomailClientOptions, ratio?: number, element?: HTMLElement | null): Dimension;
4
4
  export default calculateHeight;
package/dist/umd/index.js CHANGED
@@ -10670,7 +10670,7 @@
10670
10670
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10671
10671
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10672
10672
  var package_namespaceObject = {
10673
- rE: "13.4.3"
10673
+ rE: "13.4.4"
10674
10674
  };
10675
10675
  var defined = __webpack_require__("./node_modules/defined/index.js");
10676
10676
  var defined_default = /*#__PURE__*/ __webpack_require__.n(defined);
@@ -16187,15 +16187,11 @@
16187
16187
  return ratio;
16188
16188
  }
16189
16189
  const dimensions_getRatio = getRatio;
16190
- function calculateHeight(responsive, videoWidth, options, target, ratio, element) {
16190
+ function calculateHeight(responsive, videoWidth, options, ratio, element) {
16191
16191
  const dimension = {
16192
16192
  unit: "px"
16193
16193
  };
16194
16194
  let width = videoWidth;
16195
- if (0 === width) throw error_createError({
16196
- message: `Unable to calculate height for target ${target} when width is zero, while responsive mode is set to ${responsive}`,
16197
- options
16198
- });
16199
16195
  if (responsive && element) {
16200
16196
  const limitedDimension = dimensions_limitWidth(element, options, width);
16201
16197
  width = limitedDimension.value;
@@ -17609,15 +17605,9 @@
17609
17605
  }
17610
17606
  calculateHeight(responsive) {
17611
17607
  let videoWidth;
17612
- let target = "(unknown)";
17613
- if (this.userMedia) {
17614
- target = "userMedia";
17615
- videoWidth = this.userMedia.getVideoWidth();
17616
- } else if (this.recorderElement) {
17617
- target = "recorderElement";
17618
- videoWidth = this.recorderElement.videoWidth || this.recorderElement.width;
17619
- }
17620
- return dimensions_calculateHeight(responsive, videoWidth, this.options, target, this.getRatio(), this.recorderElement);
17608
+ if (this.userMedia) videoWidth = this.userMedia.getVideoWidth();
17609
+ else if (this.recorderElement) videoWidth = this.recorderElement.videoWidth || this.recorderElement.width;
17610
+ return dimensions_calculateHeight(responsive, videoWidth, this.options, this.getRatio(), this.recorderElement);
17621
17611
  }
17622
17612
  getRawVisualUserMedia() {
17623
17613
  return this.recorderElement;
@@ -17683,13 +17673,8 @@
17683
17673
  if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
17684
17674
  if (!height) {
17685
17675
  let element = this.visuals.getElement();
17686
- let target;
17687
- if (element) target = "visualsElement";
17688
- else {
17689
- element = document.body;
17690
- target = "document body";
17691
- }
17692
- height = dimensions_calculateHeight(responsive, videoWidth, this.options, target, ratio, element);
17676
+ if (!element) element = document.body;
17677
+ height = dimensions_calculateHeight(responsive, videoWidth, this.options, ratio, element);
17693
17678
  }
17694
17679
  if (width > 0) this.replayElement.style.width = `${width}px`;
17695
17680
  else this.replayElement.style.width = "auto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "13.4.3",
3
+ "version": "13.4.4",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -120,7 +120,7 @@
120
120
  "type-fest": "5.2.0",
121
121
  "typescript": "5.9.3",
122
122
  "typescript-eslint": "8.41.0",
123
- "vitest": "4.0.10"
123
+ "vitest": "4.0.13"
124
124
  },
125
125
  "engines": {
126
126
  "node": "^24.11.0",