videomail-client 15.3.1 → 15.3.3

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.
Files changed (49) hide show
  1. package/dist/cjs/index.cjs +27 -15
  2. package/dist/esm/client.d.ts +5 -5
  3. package/dist/esm/index.d.ts +20 -20
  4. package/dist/esm/index.js +21 -10
  5. package/dist/esm/options.d.ts +1 -1
  6. package/dist/esm/resource.d.ts +5 -5
  7. package/dist/esm/types/Delivery.d.ts +1 -1
  8. package/dist/esm/types/Videomail.d.ts +7 -7
  9. package/dist/esm/types/error.d.ts +4 -1
  10. package/dist/esm/types/events/index.d.ts +2 -2
  11. package/dist/esm/types/events/params.d.ts +3 -3
  12. package/dist/esm/types/options.d.ts +1 -1
  13. package/dist/esm/types/thread.d.ts +1 -1
  14. package/dist/esm/util/Browser.d.ts +3 -3
  15. package/dist/esm/util/CollectLogger.d.ts +1 -1
  16. package/dist/esm/util/Despot.d.ts +13 -13
  17. package/dist/esm/util/error/HTTPVideomailError.d.ts +2 -0
  18. package/dist/esm/util/error/VideomailError.d.ts +2 -2
  19. package/dist/esm/util/error/createError.d.ts +4 -3
  20. package/dist/esm/util/getBrowser.d.ts +2 -2
  21. package/dist/esm/util/getCapacitorDeviceMetadata.d.ts +1 -1
  22. package/dist/esm/util/html/dimensions/calculateHeight.d.ts +2 -2
  23. package/dist/esm/util/html/dimensions/calculateWidth.d.ts +2 -2
  24. package/dist/esm/util/html/dimensions/figureMinHeight.d.ts +1 -1
  25. package/dist/esm/util/html/dimensions/getRatio.d.ts +1 -1
  26. package/dist/esm/util/html/dimensions/limitHeight.d.ts +2 -2
  27. package/dist/esm/util/html/dimensions/limitWidth.d.ts +2 -2
  28. package/dist/esm/util/html/dimensions/useFullWidth.d.ts +1 -1
  29. package/dist/esm/util/html/media/AudioRecorder.d.ts +2 -2
  30. package/dist/esm/util/html/media/canPlayType.d.ts +1 -1
  31. package/dist/esm/util/options/audio.d.ts +1 -1
  32. package/dist/esm/util/options/mergeWithDefaultOptions.d.ts +1 -1
  33. package/dist/esm/wrappers/buttons.d.ts +3 -3
  34. package/dist/esm/wrappers/container.d.ts +8 -8
  35. package/dist/esm/wrappers/form.d.ts +12 -12
  36. package/dist/esm/wrappers/visuals/inside/recorder/countdown.d.ts +2 -2
  37. package/dist/esm/wrappers/visuals/inside/recorder/facingMode.d.ts +3 -3
  38. package/dist/esm/wrappers/visuals/inside/recorder/pausedNote.d.ts +2 -2
  39. package/dist/esm/wrappers/visuals/inside/recorder/recordNote.d.ts +1 -1
  40. package/dist/esm/wrappers/visuals/inside/recorder/recordTimer.d.ts +3 -3
  41. package/dist/esm/wrappers/visuals/inside/recorderInsides.d.ts +3 -3
  42. package/dist/esm/wrappers/visuals/notifier.d.ts +4 -4
  43. package/dist/esm/wrappers/visuals/recorder.d.ts +7 -7
  44. package/dist/esm/wrappers/visuals/replay.d.ts +5 -5
  45. package/dist/esm/wrappers/visuals/userMedia.d.ts +5 -5
  46. package/dist/esm/wrappers/visuals.d.ts +9 -9
  47. package/dist/umd/index.js +26 -13
  48. package/package.json +15 -15
  49. /package/dist/cjs/{1~236.cjs → 236~1.cjs} +0 -0
@@ -617,7 +617,7 @@ var __webpack_modules__ = {
617
617
  function makeThrottle(fps) {
618
618
  var delay = 1000 / fps;
619
619
  var lastTime = Date.now();
620
- if (fps <= 0 || fps === 1 / 0) return returnTrue;
620
+ if (fps <= 0 || 1 / 0 === fps) return returnTrue;
621
621
  var half = Math.ceil(1000 / 60) / 2;
622
622
  return function() {
623
623
  var now = Date.now();
@@ -5466,7 +5466,7 @@ var __webpack_modules__ = {
5466
5466
  for(; nBits > 0; m = 256 * m + buffer[offset + i], i += d, nBits -= 8);
5467
5467
  if (0 === e) e = 1 - eBias;
5468
5468
  else {
5469
- if (e === eMax) return m ? NaN : 1 / 0 * (s ? -1 : 1);
5469
+ if (e === eMax) return m ? 0 / 0 : (s ? -1 : 1) * 2e308;
5470
5470
  m += Math.pow(2, mLen);
5471
5471
  e -= eBias;
5472
5472
  }
@@ -5482,7 +5482,7 @@ var __webpack_modules__ = {
5482
5482
  var d = isLE ? 1 : -1;
5483
5483
  var s = value < 0 || 0 === value && 1 / value < 0 ? 1 : 0;
5484
5484
  value = Math.abs(value);
5485
- if (isNaN(value) || value === 1 / 0) {
5485
+ if (isNaN(value) || 1 / 0 === value) {
5486
5486
  m = isNaN(value) ? 1 : 0;
5487
5487
  e = eMax;
5488
5488
  } else {
@@ -5791,7 +5791,7 @@ var __webpack_modules__ = {
5791
5791
  return O.__proto__;
5792
5792
  } : null);
5793
5793
  function addNumericSeparator(num, str) {
5794
- if (num === 1 / 0 || num === -1 / 0 || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) return str;
5794
+ if (1 / 0 === num || -1 / 0 === num || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) return str;
5795
5795
  var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
5796
5796
  if ('number' == typeof num) {
5797
5797
  var int = num < 0 ? -$floor(-num) : $floor(num);
@@ -5819,7 +5819,7 @@ var __webpack_modules__ = {
5819
5819
  module.exports = function inspect_(obj, options, depth, seen) {
5820
5820
  var opts = options || {};
5821
5821
  if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) throw new TypeError('option "quoteStyle" must be "single" or "double"');
5822
- if (has(opts, 'maxStringLength') && ('number' == typeof opts.maxStringLength ? opts.maxStringLength < 0 && opts.maxStringLength !== 1 / 0 : null !== opts.maxStringLength)) throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
5822
+ if (has(opts, 'maxStringLength') && ('number' == typeof opts.maxStringLength ? opts.maxStringLength < 0 && 1 / 0 !== opts.maxStringLength : null !== opts.maxStringLength)) throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
5823
5823
  var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
5824
5824
  if ('boolean' != typeof customInspect && 'symbol' !== customInspect) throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
5825
5825
  if (has(opts, 'indent') && null !== opts.indent && '\t' !== opts.indent && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
@@ -6486,7 +6486,7 @@ var __webpack_modules__ = {
6486
6486
  };
6487
6487
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
6488
6488
  cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
6489
- var limit = options.parameterLimit === 1 / 0 ? void 0 : options.parameterLimit;
6489
+ var limit = 1 / 0 === options.parameterLimit ? void 0 : options.parameterLimit;
6490
6490
  var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded && void 0 !== limit ? limit + 1 : limit);
6491
6491
  if (options.throwOnLimitExceeded && void 0 !== limit && parts.length > limit) throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (1 === limit ? '' : 's') + ' allowed.');
6492
6492
  var skipIndex = -1;
@@ -11071,7 +11071,7 @@ var __webpack_modules__ = {
11071
11071
  var client = __webpack_require__(5734);
11072
11072
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
11073
11073
  var package_namespaceObject = {
11074
- rE: "15.3.1"
11074
+ rE: "15.3.3"
11075
11075
  };
11076
11076
  function isAudioEnabled(options) {
11077
11077
  return Boolean(options.audio.enabled);
@@ -14474,7 +14474,7 @@ var __webpack_modules__ = {
14474
14474
  }
14475
14475
  class HTTPVideomailError extends Error {
14476
14476
  constructor(...args){
14477
- super(...args), HTTPVideomailError_define_property(this, "name", "VideomailError"), HTTPVideomailError_define_property(this, "code", void 0), HTTPVideomailError_define_property(this, "status", void 0), HTTPVideomailError_define_property(this, "explanation", void 0);
14477
+ super(...args), HTTPVideomailError_define_property(this, "name", "VideomailError"), HTTPVideomailError_define_property(this, "code", void 0), HTTPVideomailError_define_property(this, "status", void 0), HTTPVideomailError_define_property(this, "explanation", void 0), HTTPVideomailError_define_property(this, "constraint", void 0), HTTPVideomailError_define_property(this, "usedConstraints", void 0);
14478
14478
  }
14479
14479
  }
14480
14480
  const error_HTTPVideomailError = HTTPVideomailError;
@@ -14666,6 +14666,8 @@ var __webpack_modules__ = {
14666
14666
  if (err) {
14667
14667
  videomailError.status = err.status;
14668
14668
  videomailError.code = err.code;
14669
+ videomailError.constraint = err.constraint;
14670
+ videomailError.usedConstraints = err.usedConstraints;
14669
14671
  }
14670
14672
  if (options.reportErrors) {
14671
14673
  const resource = new src_resource(options);
@@ -14737,7 +14739,11 @@ var __webpack_modules__ = {
14737
14739
  try {
14738
14740
  info = yield Device.getInfo();
14739
14741
  } catch (exc) {
14740
- errors.push(serializeError(exc));
14742
+ var _err_message;
14743
+ const err = serializeError(exc);
14744
+ let ignore = false;
14745
+ if (null == (_err_message = err.message) ? void 0 : _err_message.includes("Device API not available in this browser")) ignore = true;
14746
+ if (!ignore) errors.push(err);
14741
14747
  }
14742
14748
  try {
14743
14749
  battery = yield Device.getBatteryInfo();
@@ -15384,6 +15390,8 @@ var __webpack_modules__ = {
15384
15390
  };
15385
15391
  const url = `${this.options.apiUrl}/client-error/`;
15386
15392
  const capacitorDevice = yield util_getCapacitorDeviceMetadata();
15393
+ const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
15394
+ const enumerateDevices = yield navigator.mediaDevices.enumerateDevices();
15387
15395
  const fullVideomailErrorData = {
15388
15396
  capacitorDevice,
15389
15397
  browser: err.browser,
@@ -15404,6 +15412,9 @@ var __webpack_modules__ = {
15404
15412
  title: err.title,
15405
15413
  message: err.message,
15406
15414
  stack: err.stack,
15415
+ supportedConstraints,
15416
+ enumerateDevices,
15417
+ usedConstraints: err.usedConstraints,
15407
15418
  versions: {
15408
15419
  videomailClient: package_namespaceObject.rE,
15409
15420
  videomailNinjaFormPlugin: null == (_this_options_versions = this.options.versions) ? void 0 : _this_options_versions.videomailNinjaFormPlugin
@@ -17943,7 +17954,7 @@ var __webpack_modules__ = {
17943
17954
  if (notifying) return true;
17944
17955
  return this.blocking;
17945
17956
  }
17946
- userMediaErrorCallback(err) {
17957
+ userMediaErrorCallback(err, usedConstraints) {
17947
17958
  var _this_userMedia;
17948
17959
  this.userMediaLoading = false;
17949
17960
  this.clearUserMediaTimeout();
@@ -17954,7 +17965,8 @@ var __webpack_modules__ = {
17954
17965
  if (err.name !== error_VideomailError.MEDIA_DEVICE_NOT_SUPPORTED) {
17955
17966
  const videomailError = error_createError({
17956
17967
  err,
17957
- options: this.options
17968
+ options: this.options,
17969
+ usedConstraints
17958
17970
  });
17959
17971
  this.emit("ERROR", {
17960
17972
  err: videomailError
@@ -18020,11 +18032,11 @@ var __webpack_modules__ = {
18020
18032
  }
18021
18033
  this.options.logger.debug(`Recorder: our webcam constraints are: ${util_pretty(constraints)}`);
18022
18034
  this.options.logger.debug(`Recorder: available webcam constraints are: ${util_pretty(navigator.mediaDevices.getSupportedConstraints())}`);
18023
- const genuineUserMediaRequest = navigator.mediaDevices.getUserMedia(constraints);
18024
- genuineUserMediaRequest.then((localStream)=>{
18035
+ const streamPromise = navigator.mediaDevices.getUserMedia(constraints);
18036
+ streamPromise.then((localStream)=>{
18025
18037
  this.getUserMediaCallback(localStream, params);
18026
18038
  }).catch((reason)=>{
18027
- this.userMediaErrorCallback(reason);
18039
+ this.userMediaErrorCallback(reason, constraints);
18028
18040
  });
18029
18041
  }
18030
18042
  loadUserMedia(params) {
@@ -20224,7 +20236,7 @@ __webpack_require__.m = __webpack_modules__;
20224
20236
  }, []));
20225
20237
  })();
20226
20238
  (()=>{
20227
- __webpack_require__.u = (chunkId)=>"1~" + chunkId + ".cjs";
20239
+ __webpack_require__.u = (chunkId)=>"" + chunkId + "~1.cjs";
20228
20240
  })();
20229
20241
  (()=>{
20230
20242
  __webpack_require__.g = (()=>{
@@ -1,6 +1,6 @@
1
- import { PartialVideomailClientOptions } from "./types/options";
2
- import { Videomail } from "./types/Videomail";
3
- import Despot from "./util/Despot";
1
+ import { PartialVideomailClientOptions } from "./types/options.js";
2
+ import { Videomail } from "./types/Videomail.js";
3
+ import Despot from "./util/Despot.js";
4
4
  export interface StartOverParams {
5
5
  keepHidden?: boolean | undefined;
6
6
  }
@@ -23,8 +23,8 @@ declare class VideomailClient extends Despot {
23
23
  hide(): void;
24
24
  getByAlias(alias: string): Promise<Videomail>;
25
25
  getByKey(key: string): Promise<Videomail>;
26
- getThreadByAlias(alias: string): Promise<import(".").VideomailThread>;
27
- getThreadByKey(key: string): Promise<import(".").VideomailThread>;
26
+ getThreadByAlias(alias: string): Promise<import("./index.js").VideomailThread>;
27
+ getThreadByKey(key: string): Promise<import("./index.js").VideomailThread>;
28
28
  isDirty(): boolean;
29
29
  isBuilt(): boolean;
30
30
  isRecording(): boolean;
@@ -1,21 +1,21 @@
1
- import { VideoType } from "./types/VideoType";
2
- export { VideomailClient } from "./client";
3
- export type { BrowserStats } from "./types/BrowserStats";
4
- export type { VideomailCommand } from "./types/command";
5
- export type { VideomailCommandArgs } from "./types/command";
6
- export type { DeliveryRecord } from "./types/Delivery";
7
- export type { CapacitorDeviceMetadata } from "./types/device";
8
- export type { EmailAddress, EmailAddresses } from "./types/EmailAddress";
9
- export type { FullVideomailErrorData, VideomailErrorData } from "./types/error";
10
- export type { VideomailEvents } from "./types/events";
11
- export type * from "./types/events/params";
12
- export type { VideomailIdentifier } from "./types/identifier";
13
- export type { VideomailClientOptions } from "./types/options";
14
- export type { ReactionKey, ReactionLabel, ReactionPrettyByUserKey, ReactionsByUserKey, ReactionsPrettyByUserKey, ReactionType, } from "./types/reaction";
15
- export { Reactions } from "./types/reaction";
16
- export type { RecordingStats } from "./types/RecordingStats";
17
- export type { VideomailThread } from "./types/thread";
18
- export type { PartialVideomail, Videomail } from "./types/Videomail";
19
- export type { VideoTypeType } from "./types/VideoType";
20
- export { default as getCapacitorDeviceMetadata } from "./util/getCapacitorDeviceMetadata";
1
+ import { VideoType } from "./types/VideoType.js";
2
+ export { VideomailClient } from "./client.js";
3
+ export type { BrowserStats } from "./types/BrowserStats.js";
4
+ export type { VideomailCommand } from "./types/command.js";
5
+ export type { VideomailCommandArgs } from "./types/command.js";
6
+ export type { DeliveryRecord } from "./types/Delivery.js";
7
+ export type { CapacitorDeviceMetadata } from "./types/device.js";
8
+ export type { EmailAddress, EmailAddresses } from "./types/EmailAddress.js";
9
+ export type { FullVideomailErrorData, VideomailErrorData } from "./types/error.js";
10
+ export type { VideomailEvents } from "./types/events/index.js";
11
+ export type * from "./types/events/params.js";
12
+ export type { VideomailIdentifier } from "./types/identifier.js";
13
+ export type { VideomailClientOptions } from "./types/options.js";
14
+ export type { ReactionKey, ReactionLabel, ReactionPrettyByUserKey, ReactionsByUserKey, ReactionsPrettyByUserKey, ReactionType, } from "./types/reaction.js";
15
+ export { Reactions } from "./types/reaction.js";
16
+ export type { RecordingStats } from "./types/RecordingStats.js";
17
+ export type { VideomailThread } from "./types/thread.js";
18
+ export type { PartialVideomail, Videomail } from "./types/Videomail.js";
19
+ export type { VideoTypeType } from "./types/VideoType.js";
20
+ export { default as getCapacitorDeviceMetadata } from "./util/getCapacitorDeviceMetadata.js";
21
21
  export { VideoType };
package/dist/esm/index.js CHANGED
@@ -2186,7 +2186,7 @@ __webpack_require__.add({
2186
2186
  for(; nBits > 0; m = 256 * m + buffer[offset + i], i += d, nBits -= 8);
2187
2187
  if (0 === e) e = 1 - eBias;
2188
2188
  else {
2189
- if (e === eMax) return m ? NaN : 1 / 0 * (s ? -1 : 1);
2189
+ if (e === eMax) return m ? 0 / 0 : (s ? -1 : 1) * 2e308;
2190
2190
  m += Math.pow(2, mLen);
2191
2191
  e -= eBias;
2192
2192
  }
@@ -2202,7 +2202,7 @@ __webpack_require__.add({
2202
2202
  var d = isLE ? 1 : -1;
2203
2203
  var s = value < 0 || 0 === value && 1 / value < 0 ? 1 : 0;
2204
2204
  value = Math.abs(value);
2205
- if (isNaN(value) || value === 1 / 0) {
2205
+ if (isNaN(value) || 1 / 0 === value) {
2206
2206
  m = isNaN(value) ? 1 : 0;
2207
2207
  e = eMax;
2208
2208
  } else {
@@ -3621,7 +3621,7 @@ const constants = {
3621
3621
  }
3622
3622
  };
3623
3623
  var package_namespaceObject = {
3624
- rE: "15.3.1"
3624
+ rE: "15.3.3"
3625
3625
  };
3626
3626
  function isAudioEnabled(options) {
3627
3627
  return Boolean(options.audio.enabled);
@@ -3763,7 +3763,7 @@ function HTTPVideomailError_define_property(obj, key, value) {
3763
3763
  }
3764
3764
  class HTTPVideomailError extends Error {
3765
3765
  constructor(...args){
3766
- super(...args), HTTPVideomailError_define_property(this, "name", "VideomailError"), HTTPVideomailError_define_property(this, "code", void 0), HTTPVideomailError_define_property(this, "status", void 0), HTTPVideomailError_define_property(this, "explanation", void 0);
3766
+ super(...args), HTTPVideomailError_define_property(this, "name", "VideomailError"), HTTPVideomailError_define_property(this, "code", void 0), HTTPVideomailError_define_property(this, "status", void 0), HTTPVideomailError_define_property(this, "explanation", void 0), HTTPVideomailError_define_property(this, "constraint", void 0), HTTPVideomailError_define_property(this, "usedConstraints", void 0);
3767
3767
  }
3768
3768
  }
3769
3769
  const error_HTTPVideomailError = HTTPVideomailError;
@@ -3952,6 +3952,8 @@ function createError(errorParams) {
3952
3952
  if (err) {
3953
3953
  videomailError.status = err.status;
3954
3954
  videomailError.code = err.code;
3955
+ videomailError.constraint = err.constraint;
3956
+ videomailError.usedConstraints = err.usedConstraints;
3955
3957
  }
3956
3958
  if (options.reportErrors) {
3957
3959
  const resource = new src_resource(options);
@@ -3992,7 +3994,10 @@ async function getCapacitorDeviceMetadata() {
3992
3994
  try {
3993
3995
  info = await Device.getInfo();
3994
3996
  } catch (exc) {
3995
- errors.push(serializeError(exc));
3997
+ const err = serializeError(exc);
3998
+ let ignore = false;
3999
+ if (err.message?.includes("Device API not available in this browser")) ignore = true;
4000
+ if (!ignore) errors.push(err);
3996
4001
  }
3997
4002
  try {
3998
4003
  battery = await Device.getBatteryInfo();
@@ -4443,6 +4448,8 @@ class Resource {
4443
4448
  };
4444
4449
  const url = `${this.options.apiUrl}/client-error/`;
4445
4450
  const capacitorDevice = await util_getCapacitorDeviceMetadata();
4451
+ const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
4452
+ const enumerateDevices = await navigator.mediaDevices.enumerateDevices();
4446
4453
  const fullVideomailErrorData = {
4447
4454
  capacitorDevice,
4448
4455
  browser: err.browser,
@@ -4463,6 +4470,9 @@ class Resource {
4463
4470
  title: err.title,
4464
4471
  message: err.message,
4465
4472
  stack: err.stack,
4473
+ supportedConstraints,
4474
+ enumerateDevices,
4475
+ usedConstraints: err.usedConstraints,
4466
4476
  versions: {
4467
4477
  videomailClient: package_namespaceObject.rE,
4468
4478
  videomailNinjaFormPlugin: this.options.versions?.videomailNinjaFormPlugin
@@ -6834,7 +6844,7 @@ class Recorder extends util_Despot {
6834
6844
  if (notifying) return true;
6835
6845
  return this.blocking;
6836
6846
  }
6837
- userMediaErrorCallback(err) {
6847
+ userMediaErrorCallback(err, usedConstraints) {
6838
6848
  this.userMediaLoading = false;
6839
6849
  this.clearUserMediaTimeout();
6840
6850
  const characteristics = this.userMedia?.getCharacteristics();
@@ -6844,7 +6854,8 @@ class Recorder extends util_Despot {
6844
6854
  if (err.name !== error_VideomailError.MEDIA_DEVICE_NOT_SUPPORTED) {
6845
6855
  const videomailError = error_createError({
6846
6856
  err,
6847
- options: this.options
6857
+ options: this.options,
6858
+ usedConstraints
6848
6859
  });
6849
6860
  this.emit("ERROR", {
6850
6861
  err: videomailError
@@ -6910,11 +6921,11 @@ class Recorder extends util_Despot {
6910
6921
  }
6911
6922
  this.options.logger.debug(`Recorder: our webcam constraints are: ${util_pretty(constraints)}`);
6912
6923
  this.options.logger.debug(`Recorder: available webcam constraints are: ${util_pretty(navigator.mediaDevices.getSupportedConstraints())}`);
6913
- const genuineUserMediaRequest = navigator.mediaDevices.getUserMedia(constraints);
6914
- genuineUserMediaRequest.then((localStream)=>{
6924
+ const streamPromise = navigator.mediaDevices.getUserMedia(constraints);
6925
+ streamPromise.then((localStream)=>{
6915
6926
  this.getUserMediaCallback(localStream, params);
6916
6927
  }).catch((reason)=>{
6917
- this.userMediaErrorCallback(reason);
6928
+ this.userMediaErrorCallback(reason, constraints);
6918
6929
  });
6919
6930
  }
6920
6931
  loadUserMedia(params) {
@@ -1,3 +1,3 @@
1
- import { VideomailClientOptions } from "./types/options";
1
+ import { VideomailClientOptions } from "./types/options.js";
2
2
  declare const options: VideomailClientOptions;
3
3
  export default options;
@@ -1,9 +1,9 @@
1
1
  import Response from "superagent/lib/node/response";
2
- import { VideomailClientOptions } from "./types/options";
3
- import { VideomailThread } from "./types/thread";
4
- import { PartialVideomail, Videomail } from "./types/Videomail";
5
- import VideomailError from "./util/error/VideomailError";
6
- import { FormInputs } from "./wrappers/form";
2
+ import { VideomailClientOptions } from "./types/options.js";
3
+ import { VideomailThread } from "./types/thread.js";
4
+ import { PartialVideomail, Videomail } from "./types/Videomail.js";
5
+ import VideomailError from "./util/error/VideomailError.js";
6
+ import { FormInputs } from "./wrappers/form.js";
7
7
  declare class Resource {
8
8
  private readonly options;
9
9
  private readonly timezoneId;
@@ -1,4 +1,4 @@
1
- import { EmailAddress } from "./EmailAddress";
1
+ import { EmailAddress } from "./EmailAddress.js";
2
2
  interface DeliveryReport {
3
3
  userKey: string | false;
4
4
  }
@@ -1,11 +1,11 @@
1
1
  import { PartialDeep } from "type-fest";
2
- import { BrowserStats } from "./BrowserStats";
3
- import { DeliveryRecord } from "./Delivery";
4
- import { EmailAddress, EmailAddresses } from "./EmailAddress";
5
- import { ReactionsByUserKey, ReactionsPrettyByUserKey } from "./reaction";
6
- import { RecordingStats } from "./RecordingStats";
7
- import { UserKey } from "./user";
8
- import VideoFormat from "./VideoFormat";
2
+ import { BrowserStats } from "./BrowserStats.js";
3
+ import { DeliveryRecord } from "./Delivery.js";
4
+ import { EmailAddress, EmailAddresses } from "./EmailAddress.js";
5
+ import { ReactionsByUserKey, ReactionsPrettyByUserKey } from "./reaction.js";
6
+ import { RecordingStats } from "./RecordingStats.js";
7
+ import { UserKey } from "./user.js";
8
+ import VideoFormat from "./VideoFormat.js";
9
9
  export interface Videomail {
10
10
  url: string;
11
11
  subject?: string;
@@ -1,6 +1,6 @@
1
1
  import { ErrorObject } from "serialize-error";
2
2
  import type { IBrowser, ICPU, IDevice, IEngine, IOS } from "ua-parser-js";
3
- import { CapacitorDeviceMetadata } from "./device";
3
+ import { CapacitorDeviceMetadata } from "./device.js";
4
4
  export interface VideomailErrorData {
5
5
  cause?: any;
6
6
  promise?: any;
@@ -42,5 +42,8 @@ export interface FullVideomailErrorData extends VideomailErrorData {
42
42
  userAgent?: string | null | undefined;
43
43
  isBot?: boolean | undefined;
44
44
  capacitorDevice: CapacitorDeviceMetadata;
45
+ supportedConstraints?: MediaTrackSupportedConstraints | undefined;
46
+ enumerateDevices?: MediaDeviceInfo[] | undefined;
47
+ usedConstraints?: MediaStreamConstraints | undefined;
45
48
  }
46
49
  export {};
@@ -1,5 +1,5 @@
1
- import { FormReadyParams } from "../../wrappers/container";
2
- import { VideomailErrorParams, VideomailInvalidParams, VideomailPreviewParams, VideomailProgressParams, VideomailRecordingParams, VideomailStoppedParams, VideomailStoppingParams, VideomailSubmittedParams, VideomailUserMediaReadyParams, VideomailValidatingParams } from "./params";
1
+ import { FormReadyParams } from "../../wrappers/container.js";
2
+ import { VideomailErrorParams, VideomailInvalidParams, VideomailPreviewParams, VideomailProgressParams, VideomailRecordingParams, VideomailStoppedParams, VideomailStoppingParams, VideomailSubmittedParams, VideomailUserMediaReadyParams, VideomailValidatingParams } from "./params.js";
3
3
  export interface VideomailEvents {
4
4
  ASKING_WEBCAM_PERMISSION: () => void;
5
5
  BEGIN_AUDIO_ENCODING: () => void;
@@ -1,7 +1,7 @@
1
1
  import Response from "superagent/lib/node/response";
2
- import VideomailError from "../../util/error/VideomailError";
3
- import { RecordingStats } from "../RecordingStats";
4
- import { Videomail } from "../Videomail";
2
+ import VideomailError from "../../util/error/VideomailError.js";
3
+ import { RecordingStats } from "../RecordingStats.js";
4
+ import { Videomail } from "../Videomail.js";
5
5
  export interface VideomailUserMediaReadyParams {
6
6
  switchingFacingMode?: ConstrainDOMString | undefined;
7
7
  recordWhenReady?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import { PartialDeep } from "type-fest";
2
- import { PartialVideomail, Videomail } from "./Videomail";
2
+ import { PartialVideomail, Videomail } from "./Videomail.js";
3
3
  export interface VideomailClientOptions {
4
4
  logger: {
5
5
  debug: (message: unknown) => void;
@@ -1,2 +1,2 @@
1
- import { Videomail } from "./Videomail";
1
+ import { Videomail } from "./Videomail.js";
2
2
  export type VideomailThread = Videomail[];
@@ -1,5 +1,5 @@
1
- import { BrowserStats } from "../types/BrowserStats";
2
- import { VideomailClientOptions } from "../types/options";
1
+ import { BrowserStats } from "../types/BrowserStats.js";
2
+ import { VideomailClientOptions } from "../types/options.js";
3
3
  declare class Browser {
4
4
  private readonly options;
5
5
  private readonly result;
@@ -16,7 +16,7 @@ declare class Browser {
16
16
  isMobile(): boolean;
17
17
  isOkSafari(): boolean;
18
18
  getVideoType(video: HTMLVideoElement): "mp4" | "webm";
19
- getNoAccessIssue(): import("./error/VideomailError").default;
19
+ getNoAccessIssue(): import("./error/VideomailError.js").default;
20
20
  getUsefulData(): BrowserStats;
21
21
  }
22
22
  export default Browser;
@@ -1,4 +1,4 @@
1
- import { VideomailClientOptions } from "../types/options";
1
+ import { VideomailClientOptions } from "../types/options.js";
2
2
  declare class CollectLogger {
3
3
  private readonly browser;
4
4
  private readonly logger;
@@ -1,5 +1,5 @@
1
- import { VideomailEvents } from "../types/events";
2
- import { VideomailClientOptions } from "../types/options";
1
+ import { VideomailEvents } from "../types/events/index.js";
2
+ import { VideomailClientOptions } from "../types/options.js";
3
3
  declare class Despot {
4
4
  private readonly name;
5
5
  protected options: VideomailClientOptions;
@@ -20,37 +20,37 @@ declare class Despot {
20
20
  DISABLING_AUDIO: (() => void)[];
21
21
  DISCONNECTED: (() => void)[];
22
22
  ENABLING_AUDIO: (() => void)[];
23
- ERROR: ((params: import("..").VideomailErrorParams) => void)[];
23
+ ERROR: ((params: import("../index.js").VideomailErrorParams) => void)[];
24
24
  EVENT_EMITTED: (() => void)[];
25
25
  FIRST_FRAME_SENT: (() => void)[];
26
- FORM_READY: ((params: import("../wrappers/container").FormReadyParams) => void)[];
26
+ FORM_READY: ((params: import("../wrappers/container.js").FormReadyParams) => void)[];
27
27
  GOING_BACK: (() => void)[];
28
28
  HIDE: (() => void)[];
29
- INVALID: ((params: import("..").VideomailInvalidParams) => void)[];
29
+ INVALID: ((params: import("../index.js").VideomailInvalidParams) => void)[];
30
30
  INVISIBLE: (() => void)[];
31
31
  LOADED_META_DATA: (() => void)[];
32
32
  LOADING_USER_MEDIA: (() => void)[];
33
33
  NOTIFYING: (() => void)[];
34
34
  PAUSED: (() => void)[];
35
- PREVIEW: ((params?: import("..").VideomailPreviewParams) => void)[];
35
+ PREVIEW: ((params?: import("../index.js").VideomailPreviewParams) => void)[];
36
36
  PREVIEW_SHOWN: (() => void)[];
37
- PROGRESS: ((params: import("..").VideomailProgressParams) => void)[];
38
- RECORDING: ((params: import("..").VideomailRecordingParams) => void)[];
37
+ PROGRESS: ((params: import("../index.js").VideomailProgressParams) => void)[];
38
+ RECORDING: ((params: import("../index.js").VideomailRecordingParams) => void)[];
39
39
  REPLAY_SHOWN: (() => void)[];
40
40
  RESETTING: (() => void)[];
41
41
  RESUMING: (() => void)[];
42
42
  SENDING_FIRST_FRAME: (() => void)[];
43
43
  SERVER_READY: (() => void)[];
44
44
  STARTING_OVER: (() => void)[];
45
- STOPPED: ((params: import("..").VideomailStoppedParams) => void)[];
46
- STOPPING: ((params: import("..").VideomailStoppingParams) => void)[];
47
- SUBMITTED: ((params: import("..").VideomailSubmittedParams) => void)[];
45
+ STOPPED: ((params: import("../index.js").VideomailStoppedParams) => void)[];
46
+ STOPPING: ((params: import("../index.js").VideomailStoppingParams) => void)[];
47
+ SUBMITTED: ((params: import("../index.js").VideomailSubmittedParams) => void)[];
48
48
  SUBMITTING: (() => void)[];
49
49
  SWITCH_FACING_MODE: (() => void)[];
50
50
  UNLOADING: (() => void)[];
51
- USER_MEDIA_READY: ((params: import("..").VideomailUserMediaReadyParams) => void)[];
51
+ USER_MEDIA_READY: ((params: import("../index.js").VideomailUserMediaReadyParams) => void)[];
52
52
  VALID: (() => void)[];
53
- VALIDATING: ((params?: import("..").VideomailValidatingParams) => void)[];
53
+ VALIDATING: ((params?: import("../index.js").VideomailValidatingParams) => void)[];
54
54
  VISIBLE: (() => void)[];
55
55
  WINDOW_RESIZE: ((source: string) => void)[];
56
56
  }>[E];
@@ -3,5 +3,7 @@ declare class HTTPVideomailError extends Error {
3
3
  code?: string | undefined;
4
4
  status?: number | undefined;
5
5
  explanation?: string | undefined;
6
+ constraint?: string | undefined;
7
+ usedConstraints?: MediaStreamConstraints | undefined;
6
8
  }
7
9
  export default HTTPVideomailError;
@@ -1,6 +1,6 @@
1
1
  import { IBrowser, ICPU, IDevice, IEngine, IOS } from "ua-parser-js";
2
- import { VideomailClientOptions } from "../../types/options";
3
- import HTTPVideomailError from "./HTTPVideomailError";
2
+ import { VideomailClientOptions } from "../../types/options.js";
3
+ import HTTPVideomailError from "./HTTPVideomailError.js";
4
4
  export interface ErrData extends ErrorOptions {
5
5
  explanation: string | undefined;
6
6
  logLines?: string[] | undefined;
@@ -1,6 +1,6 @@
1
- import { VideomailClientOptions } from "../../types/options";
2
- import HTTPVideomailError from "./HTTPVideomailError";
3
- import VideomailError from "./VideomailError";
1
+ import { VideomailClientOptions } from "../../types/options.js";
2
+ import HTTPVideomailError from "./HTTPVideomailError.js";
3
+ import VideomailError from "./VideomailError.js";
4
4
  interface ErrorParams {
5
5
  err?: HTTPVideomailError;
6
6
  exc?: unknown;
@@ -8,6 +8,7 @@ interface ErrorParams {
8
8
  explanation?: string;
9
9
  options: VideomailClientOptions;
10
10
  classList?: string[];
11
+ usedConstraints?: MediaStreamConstraints;
11
12
  }
12
13
  declare function createError(errorParams: ErrorParams): VideomailError;
13
14
  export default createError;
@@ -1,4 +1,4 @@
1
- import { VideomailClientOptions } from "../types/options";
2
- import Browser from "./Browser";
1
+ import { VideomailClientOptions } from "../types/options.js";
2
+ import Browser from "./Browser.js";
3
3
  declare function getBrowser(localOptions: VideomailClientOptions): Browser;
4
4
  export default getBrowser;
@@ -1,3 +1,3 @@
1
- import { CapacitorDeviceMetadata } from "../types/device";
1
+ import { CapacitorDeviceMetadata } from "../types/device.js";
2
2
  declare function getCapacitorDeviceMetadata(): Promise<CapacitorDeviceMetadata>;
3
3
  export default getCapacitorDeviceMetadata;
@@ -1,4 +1,4 @@
1
- import { Dimension } from "../../../types/dimension";
2
- import { VideomailClientOptions } from "../../../types/options";
1
+ import { Dimension } from "../../../types/dimension.js";
2
+ import { VideomailClientOptions } from "../../../types/options.js";
3
3
  declare function calculateHeight(responsive: boolean, videoWidth: number | undefined, options: VideomailClientOptions, ratio?: number, element?: HTMLElement | null): Dimension;
4
4
  export default calculateHeight;
@@ -1,4 +1,4 @@
1
- import { Dimension } from "../../../types/dimension";
2
- import { VideomailClientOptions } from "../../../types/options";
1
+ import { Dimension } from "../../../types/dimension.js";
2
+ import { VideomailClientOptions } from "../../../types/options.js";
3
3
  declare function calculateWidth(responsive: boolean, options: VideomailClientOptions, videoHeight?: number, ratio?: number): Dimension;
4
4
  export default calculateWidth;
@@ -1,3 +1,3 @@
1
- import { VideomailClientOptions } from "../../../types/options";
1
+ import { VideomailClientOptions } from "../../../types/options.js";
2
2
  declare function figureMinHeight(height: number | undefined, options: VideomailClientOptions): number | undefined;
3
3
  export default figureMinHeight;
@@ -1,3 +1,3 @@
1
- import { VideomailClientOptions } from "../../../types/options";
1
+ import { VideomailClientOptions } from "../../../types/options.js";
2
2
  declare function getRatio(options: VideomailClientOptions, videoHeight?: number, videoWidth?: number): number;
3
3
  export default getRatio;
@@ -1,4 +1,4 @@
1
- import { Dimension } from "../../../types/dimension";
2
- import { VideomailClientOptions } from "../../../types/options";
1
+ import { Dimension } from "../../../types/dimension.js";
2
+ import { VideomailClientOptions } from "../../../types/options.js";
3
3
  declare function limitHeight(height: number | undefined, options: VideomailClientOptions, calledFrom: string): Dimension;
4
4
  export default limitHeight;
@@ -1,4 +1,4 @@
1
- import { Dimension } from "../../../types/dimension";
2
- import { VideomailClientOptions } from "../../../types/options";
1
+ import { Dimension } from "../../../types/dimension.js";
2
+ import { VideomailClientOptions } from "../../../types/options.js";
3
3
  declare function limitWidth(element: HTMLElement, options: VideomailClientOptions, width?: number): Dimension;
4
4
  export default limitWidth;
@@ -1,3 +1,3 @@
1
- import { Dimension } from "../../../types/dimension";
1
+ import { Dimension } from "../../../types/dimension.js";
2
2
  declare function useFullWidth(mobileBreakPoint?: number): Dimension | undefined;
3
3
  export default useFullWidth;
@@ -1,6 +1,6 @@
1
1
  import AudioSample from "audio-sample";
2
- import { VideomailClientOptions } from "../../../types/options";
3
- import UserMedia from "../../../wrappers/visuals/userMedia";
2
+ import { VideomailClientOptions } from "../../../types/options.js";
3
+ import UserMedia from "../../../wrappers/visuals/userMedia.js";
4
4
  export type AudioProcessCB = (audioSample: AudioSample) => void;
5
5
  declare class AudioRecorder {
6
6
  private scriptProcessor?;
@@ -1,3 +1,3 @@
1
- import { VideoTypeType } from "./../../../types/VideoType";
1
+ import { VideoTypeType } from "./../../../types/VideoType.js";
2
2
  declare function canPlayType(video: HTMLVideoElement, type: VideoTypeType): false | "maybe" | "probably";
3
3
  export default canPlayType;
@@ -1,4 +1,4 @@
1
- import { VideomailClientOptions } from "../../types/options";
1
+ import { VideomailClientOptions } from "../../types/options.js";
2
2
  declare function isAudioEnabled(options: VideomailClientOptions): boolean;
3
3
  declare function setAudioEnabled(enabled: boolean, options: VideomailClientOptions): VideomailClientOptions;
4
4
  declare function isAutoPauseEnabled(options: VideomailClientOptions): boolean;
@@ -1,3 +1,3 @@
1
- import { PartialVideomailClientOptions, VideomailClientOptions } from "../../types/options";
1
+ import { PartialVideomailClientOptions, VideomailClientOptions } from "../../types/options.js";
2
2
  declare function mergeWithDefaultOptions(options?: PartialVideomailClientOptions): VideomailClientOptions;
3
3
  export default mergeWithDefaultOptions;
@@ -1,6 +1,6 @@
1
- import { VideomailClientOptions } from "../types/options";
2
- import Despot from "../util/Despot";
3
- import Container from "./container";
1
+ import { VideomailClientOptions } from "../types/options.js";
2
+ import Despot from "../util/Despot.js";
3
+ import Container from "./container.js";
4
4
  declare class Buttons extends Despot {
5
5
  private readonly container;
6
6
  private buttonsElement?;
@@ -1,9 +1,9 @@
1
1
  import "./../styles/main.styl";
2
- import { ShowParams, StartOverParams } from "../client";
3
- import { VideomailClientOptions } from "../types/options";
4
- import { Videomail } from "../types/Videomail";
5
- import Despot from "../util/Despot";
6
- import { FormInputs, FormMethodType } from "./form";
2
+ import { ShowParams, StartOverParams } from "../client.js";
3
+ import { VideomailClientOptions } from "../types/options.js";
4
+ import { Videomail } from "../types/Videomail.js";
5
+ import Despot from "../util/Despot.js";
6
+ import { FormInputs, FormMethodType } from "./form.js";
7
7
  interface BuildOptions {
8
8
  playerOnly?: boolean;
9
9
  replayParentElementId?: string | undefined;
@@ -41,8 +41,8 @@ declare class Container extends Despot {
41
41
  private unloadChildren;
42
42
  private hideMySelf;
43
43
  private submitVideomail;
44
- limitWidth(width?: number): import("../types/dimension").Dimension | undefined;
45
- limitHeight(height: number | undefined): import("../types/dimension").Dimension;
44
+ limitWidth(width?: number): import("../types/dimension.js").Dimension | undefined;
45
+ limitHeight(height: number | undefined): import("../types/dimension.js").Dimension;
46
46
  private areVisualsHidden;
47
47
  hasElement(): boolean;
48
48
  getSubmitButton(): HTMLButtonElement | undefined;
@@ -70,7 +70,7 @@ declare class Container extends Despot {
70
70
  isBuilt(): boolean;
71
71
  isReplayShown(): boolean;
72
72
  isDirty(): boolean;
73
- getReplay(): import("./visuals/replay").default;
73
+ getReplay(): import("./visuals/replay.js").default;
74
74
  isOutsideElementOf(element: HTMLElement): boolean;
75
75
  loadForm(videomail: Videomail): void;
76
76
  enableAudio(): void;
@@ -1,7 +1,7 @@
1
- import { VideomailClientOptions } from "../types/options";
2
- import { Videomail } from "../types/Videomail";
3
- import Despot from "../util/Despot";
4
- import Container from "./container";
1
+ import { VideomailClientOptions } from "../types/options.js";
2
+ import { Videomail } from "../types/Videomail.js";
3
+ import Despot from "../util/Despot.js";
4
+ import Container from "./container.js";
5
5
  export type FormInputs = Record<string, string>;
6
6
  export declare const FormMethod: {
7
7
  readonly POST: "post";
@@ -20,11 +20,11 @@ declare class Form extends Despot {
20
20
  url?: string;
21
21
  subject?: string;
22
22
  body?: string;
23
- from?: import("..").EmailAddress;
23
+ from?: import("../index.js").EmailAddress;
24
24
  fromNickName?: string | null;
25
- to?: import("..").EmailAddresses | undefined;
26
- bcc?: import("..").EmailAddresses | undefined;
27
- cc?: import("..").EmailAddresses | undefined;
25
+ to?: import("../index.js").EmailAddresses | undefined;
26
+ bcc?: import("../index.js").EmailAddresses | undefined;
27
+ cc?: import("../index.js").EmailAddresses | undefined;
28
28
  alias?: string;
29
29
  replyAllUrl?: string;
30
30
  replyUrl?: string;
@@ -206,11 +206,11 @@ declare class Form extends Despot {
206
206
  url?: string;
207
207
  subject?: string;
208
208
  body?: string;
209
- from?: import("..").EmailAddress;
209
+ from?: import("../index.js").EmailAddress;
210
210
  fromNickName?: string | null;
211
- to?: import("..").EmailAddresses | undefined;
212
- bcc?: import("..").EmailAddresses | undefined;
213
- cc?: import("..").EmailAddresses | undefined;
211
+ to?: import("../index.js").EmailAddresses | undefined;
212
+ bcc?: import("../index.js").EmailAddresses | undefined;
213
+ cc?: import("../index.js").EmailAddresses | undefined;
214
214
  alias?: string;
215
215
  replyAllUrl?: string;
216
216
  replyUrl?: string;
@@ -1,5 +1,5 @@
1
- import { VideomailClientOptions } from "../../../../types/options";
2
- import Visuals from "../../../visuals";
1
+ import { VideomailClientOptions } from "../../../../types/options.js";
2
+ import Visuals from "../../../visuals.js";
3
3
  declare class Countdown {
4
4
  private readonly visuals;
5
5
  private readonly options;
@@ -1,6 +1,6 @@
1
- import { VideomailClientOptions } from "../../../../types/options";
2
- import Despot from "../../../../util/Despot";
3
- import Visuals from "../../../visuals";
1
+ import { VideomailClientOptions } from "../../../../types/options.js";
2
+ import Despot from "../../../../util/Despot.js";
3
+ import Visuals from "../../../visuals.js";
4
4
  declare class FacingMode extends Despot {
5
5
  private readonly visuals;
6
6
  private facingModeElement?;
@@ -1,5 +1,5 @@
1
- import { VideomailClientOptions } from "../../../../types/options";
2
- import Visuals from "../../../visuals";
1
+ import { VideomailClientOptions } from "../../../../types/options.js";
2
+ import Visuals from "../../../visuals.js";
3
3
  declare class PausedNote {
4
4
  private readonly visuals;
5
5
  private readonly options;
@@ -1,4 +1,4 @@
1
- import Visuals from "../../../visuals";
1
+ import Visuals from "../../../visuals.js";
2
2
  declare class RecordNote {
3
3
  private readonly visuals;
4
4
  private recordNoteElement;
@@ -1,6 +1,6 @@
1
- import { VideomailClientOptions } from "../../../../types/options";
2
- import Visuals from "../../../visuals";
3
- import RecordNote from "./recordNote";
1
+ import { VideomailClientOptions } from "../../../../types/options.js";
2
+ import Visuals from "../../../visuals.js";
3
+ import RecordNote from "./recordNote.js";
4
4
  declare class RecordTimer {
5
5
  private readonly visuals;
6
6
  private readonly recordNote;
@@ -1,6 +1,6 @@
1
- import { VideomailClientOptions } from "../../../types/options";
2
- import Despot from "../../../util/Despot";
3
- import Visuals from "../../visuals";
1
+ import { VideomailClientOptions } from "../../../types/options.js";
2
+ import Despot from "../../../util/Despot.js";
3
+ import Visuals from "../../visuals.js";
4
4
  declare class RecorderInsides extends Despot {
5
5
  private readonly recordNote;
6
6
  private readonly recordTimer;
@@ -1,7 +1,7 @@
1
- import { VideomailClientOptions } from "../../types/options";
2
- import Despot from "../../util/Despot";
3
- import VideomailError from "../../util/error/VideomailError";
4
- import Visuals from "../visuals";
1
+ import { VideomailClientOptions } from "../../types/options.js";
2
+ import Despot from "../../util/Despot.js";
3
+ import VideomailError from "../../util/error/VideomailError.js";
4
+ import Visuals from "../visuals.js";
5
5
  interface MessageOptions {
6
6
  problem?: boolean;
7
7
  }
@@ -1,10 +1,10 @@
1
- import { Dimension } from "../../types/dimension";
2
- import { VideomailClientOptions } from "../../types/options";
3
- import { RecordingStats } from "../../types/RecordingStats";
4
- import Despot from "../../util/Despot";
5
- import { UnloadParams } from "../container";
6
- import Visuals from "../visuals";
7
- import Replay from "./replay";
1
+ import { Dimension } from "../../types/dimension.js";
2
+ import { VideomailClientOptions } from "../../types/options.js";
3
+ import { RecordingStats } from "../../types/RecordingStats.js";
4
+ import Despot from "../../util/Despot.js";
5
+ import { UnloadParams } from "../container.js";
6
+ import Visuals from "../visuals.js";
7
+ import Replay from "./replay.js";
8
8
  export interface StopParams {
9
9
  limitReached?: boolean;
10
10
  }
@@ -1,8 +1,8 @@
1
- import { VideomailClientOptions } from "../../types/options";
2
- import { Videomail } from "../../types/Videomail";
3
- import Despot from "../../util/Despot";
4
- import { UnloadParams } from "../container";
5
- import Visuals from "../visuals";
1
+ import { VideomailClientOptions } from "../../types/options.js";
2
+ import { Videomail } from "../../types/Videomail.js";
3
+ import Despot from "../../util/Despot.js";
4
+ import { UnloadParams } from "../container.js";
5
+ import Visuals from "../visuals.js";
6
6
  declare class Replay extends Despot {
7
7
  private readonly visuals;
8
8
  private built;
@@ -1,8 +1,8 @@
1
- import { Dimension } from "../../types/dimension";
2
- import { VideomailClientOptions } from "../../types/options";
3
- import Despot from "../../util/Despot";
4
- import { AudioProcessCB } from "../../util/html/media/AudioRecorder";
5
- import Recorder from "./recorder";
1
+ import { Dimension } from "../../types/dimension.js";
2
+ import { VideomailClientOptions } from "../../types/options.js";
3
+ import Despot from "../../util/Despot.js";
4
+ import { AudioProcessCB } from "../../util/html/media/AudioRecorder.js";
5
+ import Recorder from "./recorder.js";
6
6
  interface StopParams {
7
7
  aboutToInitialize: boolean;
8
8
  switchingFacingMode: any;
@@ -1,11 +1,11 @@
1
- import { ShowParams } from "../client";
2
- import { Dimension } from "../types/dimension";
3
- import { VideomailClientOptions } from "../types/options";
4
- import Despot from "../util/Despot";
5
- import VideomailError from "../util/error/VideomailError";
6
- import Container, { UnloadParams } from "./container";
7
- import Recorder, { StopParams } from "./visuals/recorder";
8
- import Replay from "./visuals/replay";
1
+ import { ShowParams } from "../client.js";
2
+ import { Dimension } from "../types/dimension.js";
3
+ import { VideomailClientOptions } from "../types/options.js";
4
+ import Despot from "../util/Despot.js";
5
+ import VideomailError from "../util/error/VideomailError.js";
6
+ import Container, { UnloadParams } from "./container.js";
7
+ import Recorder, { StopParams } from "./visuals/recorder.js";
8
+ import Replay from "./visuals/replay.js";
9
9
  declare class Visuals extends Despot {
10
10
  private readonly container;
11
11
  private readonly replay;
@@ -42,7 +42,7 @@ declare class Visuals extends Despot {
42
42
  recordOrStop(): void;
43
43
  getRecorder(): Recorder;
44
44
  validate(): boolean;
45
- getRecordingStats(): import("..").RecordingStats | undefined;
45
+ getRecordingStats(): import("../index.js").RecordingStats | undefined;
46
46
  getAudioSampleRate(): number | undefined;
47
47
  isPaused(): boolean | undefined;
48
48
  error(err: VideomailError): void;
package/dist/umd/index.js CHANGED
@@ -738,7 +738,7 @@
738
738
  function makeThrottle(fps) {
739
739
  var delay = 1000 / fps;
740
740
  var lastTime = Date.now();
741
- if (fps <= 0 || fps === 1 / 0) return returnTrue;
741
+ if (fps <= 0 || 1 / 0 === fps) return returnTrue;
742
742
  var half = Math.ceil(1000 / 60) / 2;
743
743
  return function() {
744
744
  var now = Date.now();
@@ -5587,7 +5587,7 @@
5587
5587
  for(; nBits > 0; m = 256 * m + buffer[offset + i], i += d, nBits -= 8);
5588
5588
  if (0 === e) e = 1 - eBias;
5589
5589
  else {
5590
- if (e === eMax) return m ? NaN : 1 / 0 * (s ? -1 : 1);
5590
+ if (e === eMax) return m ? 0 / 0 : (s ? -1 : 1) * 2e308;
5591
5591
  m += Math.pow(2, mLen);
5592
5592
  e -= eBias;
5593
5593
  }
@@ -5603,7 +5603,7 @@
5603
5603
  var d = isLE ? 1 : -1;
5604
5604
  var s = value < 0 || 0 === value && 1 / value < 0 ? 1 : 0;
5605
5605
  value = Math.abs(value);
5606
- if (isNaN(value) || value === 1 / 0) {
5606
+ if (isNaN(value) || 1 / 0 === value) {
5607
5607
  m = isNaN(value) ? 1 : 0;
5608
5608
  e = eMax;
5609
5609
  } else {
@@ -5912,7 +5912,7 @@
5912
5912
  return O.__proto__;
5913
5913
  } : null);
5914
5914
  function addNumericSeparator(num, str) {
5915
- if (num === 1 / 0 || num === -1 / 0 || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) return str;
5915
+ if (1 / 0 === num || -1 / 0 === num || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) return str;
5916
5916
  var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
5917
5917
  if ('number' == typeof num) {
5918
5918
  var int = num < 0 ? -$floor(-num) : $floor(num);
@@ -5940,7 +5940,7 @@
5940
5940
  module1.exports = function inspect_(obj, options, depth, seen) {
5941
5941
  var opts = options || {};
5942
5942
  if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) throw new TypeError('option "quoteStyle" must be "single" or "double"');
5943
- if (has(opts, 'maxStringLength') && ('number' == typeof opts.maxStringLength ? opts.maxStringLength < 0 && opts.maxStringLength !== 1 / 0 : null !== opts.maxStringLength)) throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
5943
+ if (has(opts, 'maxStringLength') && ('number' == typeof opts.maxStringLength ? opts.maxStringLength < 0 && 1 / 0 !== opts.maxStringLength : null !== opts.maxStringLength)) throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
5944
5944
  var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
5945
5945
  if ('boolean' != typeof customInspect && 'symbol' !== customInspect) throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
5946
5946
  if (has(opts, 'indent') && null !== opts.indent && '\t' !== opts.indent && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
@@ -6607,7 +6607,7 @@
6607
6607
  };
6608
6608
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
6609
6609
  cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
6610
- var limit = options.parameterLimit === 1 / 0 ? void 0 : options.parameterLimit;
6610
+ var limit = 1 / 0 === options.parameterLimit ? void 0 : options.parameterLimit;
6611
6611
  var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded && void 0 !== limit ? limit + 1 : limit);
6612
6612
  if (options.throwOnLimitExceeded && void 0 !== limit && parts.length > limit) throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (1 === limit ? '' : 's') + ' allowed.');
6613
6613
  var skipIndex = -1;
@@ -11495,7 +11495,7 @@
11495
11495
  var client = __webpack_require__(5734);
11496
11496
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
11497
11497
  var package_namespaceObject = {
11498
- rE: "15.3.1"
11498
+ rE: "15.3.3"
11499
11499
  };
11500
11500
  function isAudioEnabled(options) {
11501
11501
  return Boolean(options.audio.enabled);
@@ -14881,6 +14881,8 @@
14881
14881
  code;
14882
14882
  status;
14883
14883
  explanation;
14884
+ constraint;
14885
+ usedConstraints;
14884
14886
  }
14885
14887
  const error_HTTPVideomailError = HTTPVideomailError;
14886
14888
  class VideomailError extends error_HTTPVideomailError {
@@ -15074,6 +15076,8 @@
15074
15076
  if (err) {
15075
15077
  videomailError.status = err.status;
15076
15078
  videomailError.code = err.code;
15079
+ videomailError.constraint = err.constraint;
15080
+ videomailError.usedConstraints = err.usedConstraints;
15077
15081
  }
15078
15082
  if (options.reportErrors) {
15079
15083
  const resource = new src_resource(options);
@@ -15118,7 +15122,10 @@
15118
15122
  try {
15119
15123
  info = await Device.getInfo();
15120
15124
  } catch (exc) {
15121
- errors.push(serializeError(exc));
15125
+ const err = serializeError(exc);
15126
+ let ignore = false;
15127
+ if (err.message?.includes("Device API not available in this browser")) ignore = true;
15128
+ if (!ignore) errors.push(err);
15122
15129
  }
15123
15130
  try {
15124
15131
  battery = await Device.getBatteryInfo();
@@ -15662,6 +15669,8 @@
15662
15669
  };
15663
15670
  const url = `${this.options.apiUrl}/client-error/`;
15664
15671
  const capacitorDevice = await util_getCapacitorDeviceMetadata();
15672
+ const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
15673
+ const enumerateDevices = await navigator.mediaDevices.enumerateDevices();
15665
15674
  const fullVideomailErrorData = {
15666
15675
  capacitorDevice,
15667
15676
  browser: err.browser,
@@ -15682,6 +15691,9 @@
15682
15691
  title: err.title,
15683
15692
  message: err.message,
15684
15693
  stack: err.stack,
15694
+ supportedConstraints,
15695
+ enumerateDevices,
15696
+ usedConstraints: err.usedConstraints,
15685
15697
  versions: {
15686
15698
  videomailClient: package_namespaceObject.rE,
15687
15699
  videomailNinjaFormPlugin: this.options.versions?.videomailNinjaFormPlugin
@@ -18097,7 +18109,7 @@
18097
18109
  if (notifying) return true;
18098
18110
  return this.blocking;
18099
18111
  }
18100
- userMediaErrorCallback(err) {
18112
+ userMediaErrorCallback(err, usedConstraints) {
18101
18113
  this.userMediaLoading = false;
18102
18114
  this.clearUserMediaTimeout();
18103
18115
  const characteristics = this.userMedia?.getCharacteristics();
@@ -18107,7 +18119,8 @@
18107
18119
  if (err.name !== error_VideomailError.MEDIA_DEVICE_NOT_SUPPORTED) {
18108
18120
  const videomailError = error_createError({
18109
18121
  err,
18110
- options: this.options
18122
+ options: this.options,
18123
+ usedConstraints
18111
18124
  });
18112
18125
  this.emit("ERROR", {
18113
18126
  err: videomailError
@@ -18173,11 +18186,11 @@
18173
18186
  }
18174
18187
  this.options.logger.debug(`Recorder: our webcam constraints are: ${util_pretty(constraints)}`);
18175
18188
  this.options.logger.debug(`Recorder: available webcam constraints are: ${util_pretty(navigator.mediaDevices.getSupportedConstraints())}`);
18176
- const genuineUserMediaRequest = navigator.mediaDevices.getUserMedia(constraints);
18177
- genuineUserMediaRequest.then((localStream)=>{
18189
+ const streamPromise = navigator.mediaDevices.getUserMedia(constraints);
18190
+ streamPromise.then((localStream)=>{
18178
18191
  this.getUserMediaCallback(localStream, params);
18179
18192
  }).catch((reason)=>{
18180
- this.userMediaErrorCallback(reason);
18193
+ this.userMediaErrorCallback(reason, constraints);
18181
18194
  });
18182
18195
  }
18183
18196
  loadUserMedia(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "15.3.1",
3
+ "version": "15.3.3",
4
4
  "description": "A wicked npm package to record videos directly in the browser, for Deaf and Sign Language!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -76,26 +76,26 @@
76
76
  "websocket-stream": "5.5.2"
77
77
  },
78
78
  "devDependencies": {
79
- "@chromatic-com/storybook": "5.3.0",
80
- "@eslint/config-inspector": "3.3.0",
79
+ "@chromatic-com/storybook": "5.3.1",
80
+ "@eslint/config-inspector": "3.4.0",
81
81
  "@eslint/js": "10.0.1",
82
82
  "@rsbuild/plugin-node-polyfill": "1.4.6",
83
83
  "@rsbuild/plugin-stylus": "2.0.1",
84
84
  "@rsdoctor/rspack-plugin": "1.6.3",
85
- "@rslib/core": "0.23.2",
86
- "@storybook/addon-a11y": "10.5.10",
87
- "@storybook/addon-docs": "10.5.10",
88
- "@storybook/addon-links": "10.5.10",
89
- "@storybook/html": "10.5.10",
85
+ "@rslib/core": "1.0.0",
86
+ "@storybook/addon-a11y": "10.6.0",
87
+ "@storybook/addon-docs": "10.6.0",
88
+ "@storybook/addon-links": "10.6.0",
89
+ "@storybook/html": "10.6.0",
90
90
  "@tsconfig/node26": "26.0.1",
91
91
  "@tsconfig/strictest": "2.0.8",
92
92
  "@types/defined": "1.0.2",
93
- "@types/node": "26.4.0",
93
+ "@types/node": "26.4.1",
94
94
  "@types/superagent": "8.1.11",
95
95
  "@types/ua-parser-js": "0.7.39",
96
96
  "@vitest/eslint-plugin": "1.6.27",
97
97
  "audit-ci": "7.1.0",
98
- "chromatic": "18.7.1",
98
+ "chromatic": "18.7.2",
99
99
  "cross-env": "10.1.0",
100
100
  "eslint": "10.9.1",
101
101
  "eslint-import-resolver-typescript": "4.4.5",
@@ -105,21 +105,21 @@
105
105
  "eslint-plugin-package-json": "1.8.0",
106
106
  "eslint-plugin-regexp": "3.2.0",
107
107
  "eslint-plugin-simple-import-sort": "14.0.0",
108
- "globals": "17.11.0",
108
+ "globals": "17.12.0",
109
109
  "jsdom": "30.0.1",
110
110
  "msw": "2.15.0",
111
- "msw-storybook-addon": "2.0.7",
111
+ "msw-storybook-addon": "3.0.0",
112
112
  "prettier": "3.9.6",
113
113
  "prettier-plugin-curly": "0.4.1",
114
114
  "prettier-plugin-jsdoc": "1.8.1",
115
115
  "prettier-plugin-packagejson": "3.0.2",
116
116
  "prettier-plugin-sh": "0.19.0",
117
117
  "release-it": "21.0.2",
118
- "storybook": "10.5.10",
118
+ "storybook": "10.6.0",
119
119
  "storybook-html-rsbuild": "3.4.2",
120
- "type-fest": "5.8.0",
120
+ "type-fest": "5.9.0",
121
121
  "typescript": "6.0.3",
122
- "typescript-eslint": "8.68.0",
122
+ "typescript-eslint": "8.69.0",
123
123
  "vitest": "4.1.11"
124
124
  },
125
125
  "engines": {
File without changes