videomail-client 15.7.13 → 15.7.14

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.
@@ -1575,7 +1575,7 @@ var __webpack_modules__ = {
1575
1575
  return intrinsic;
1576
1576
  };
1577
1577
  },
1578
- r (module) {
1578
+ rX (module) {
1579
1579
  module.exports = Emitter;
1580
1580
  function Emitter(obj) {
1581
1581
  if (obj) return mixin(obj);
@@ -1832,7 +1832,7 @@ var __webpack_modules__ = {
1832
1832
  xF (module, __unused_rspack_exports, __webpack_require__) {
1833
1833
  "use strict";
1834
1834
  var document1 = __webpack_require__("g");
1835
- var Event = __webpack_require__("cE");
1835
+ var Event1 = __webpack_require__("cE");
1836
1836
  var Keys = __webpack_require__("Dy");
1837
1837
  module.exports = Visibility;
1838
1838
  function Visibility() {
@@ -1840,7 +1840,7 @@ var __webpack_modules__ = {
1840
1840
  if (!keys) return noopShim();
1841
1841
  return {
1842
1842
  visible: visible,
1843
- onChange: Event(listen)
1843
+ onChange: Event1(listen)
1844
1844
  };
1845
1845
  function visible() {
1846
1846
  return !document1[keys.hidden];
@@ -4868,8 +4868,8 @@ var __webpack_modules__ = {
4868
4868
  } : null;
4869
4869
  },
4870
4870
  Ne (module) {
4871
- module.exports = Event;
4872
- function Event() {
4871
+ module.exports = Event1;
4872
+ function Event1() {
4873
4873
  var listeners = [];
4874
4874
  return {
4875
4875
  broadcast: broadcast,
@@ -4889,10 +4889,10 @@ var __webpack_modules__ = {
4889
4889
  }
4890
4890
  },
4891
4891
  cE (module, __unused_rspack_exports, __webpack_require__) {
4892
- var Event = __webpack_require__("Ne");
4892
+ var Event1 = __webpack_require__("Ne");
4893
4893
  module.exports = Source;
4894
4894
  function Source(broadcaster) {
4895
- var tuple = Event();
4895
+ var tuple = Event1();
4896
4896
  broadcaster(tuple.broadcast);
4897
4897
  return tuple.listen;
4898
4898
  }
@@ -6783,7 +6783,7 @@ var __webpack_modules__ = {
6783
6783
  return fn;
6784
6784
  };
6785
6785
  },
6786
- x5 (module, __unused_rspack_exports, __webpack_require__) {
6786
+ x (module, __unused_rspack_exports, __webpack_require__) {
6787
6787
  "use strict";
6788
6788
  var inspect = __webpack_require__("L");
6789
6789
  var $TypeError = __webpack_require__("N");
@@ -6944,7 +6944,7 @@ var __webpack_modules__ = {
6944
6944
  "use strict";
6945
6945
  var $TypeError = __webpack_require__("N");
6946
6946
  var inspect = __webpack_require__("L");
6947
- var getSideChannelList = __webpack_require__("x5");
6947
+ var getSideChannelList = __webpack_require__("x");
6948
6948
  var getSideChannelMap = __webpack_require__("J");
6949
6949
  var getSideChannelWeakMap = __webpack_require__("c");
6950
6950
  var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
@@ -7041,7 +7041,7 @@ var __webpack_modules__ = {
7041
7041
  console.warn('Using browser-only version of superagent in non-browser environment');
7042
7042
  root = void 0;
7043
7043
  } else root = self;
7044
- const Emitter = __webpack_require__("r");
7044
+ const Emitter = __webpack_require__("rX");
7045
7045
  const safeStringify = __webpack_require__("X");
7046
7046
  const qs = __webpack_require__("b");
7047
7047
  const RequestBase = __webpack_require__("d");
@@ -10970,7 +10970,7 @@ var __webpack_exports__ = {};
10970
10970
  var client = __webpack_require__("Q");
10971
10971
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10972
10972
  var package_namespaceObject = {
10973
- rE: "15.7.13"
10973
+ rE: "15.7.14"
10974
10974
  };
10975
10975
  function isAudioEnabled(options) {
10976
10976
  return Boolean(options.audio.enabled);
@@ -10984,6 +10984,52 @@ var __webpack_exports__ = {};
10984
10984
  }
10985
10985
  var util = __webpack_require__("S");
10986
10986
  var util_default = /*#__PURE__*/ __webpack_require__.n(util);
10987
+ function getEventDetails(event) {
10988
+ const eventWithErrorDetails = event;
10989
+ const details = {
10990
+ constructor: event.constructor.name,
10991
+ type: event.type,
10992
+ isTrusted: event.isTrusted,
10993
+ bubbles: event.bubbles,
10994
+ cancelable: event.cancelable,
10995
+ composed: event.composed,
10996
+ defaultPrevented: event.defaultPrevented,
10997
+ eventPhase: event.eventPhase,
10998
+ timeStamp: event.timeStamp,
10999
+ returnValue: eventWithErrorDetails.returnValue,
11000
+ cancelBubble: eventWithErrorDetails.cancelBubble
11001
+ };
11002
+ for (const property of [
11003
+ "message",
11004
+ "filename",
11005
+ "lineno",
11006
+ "colno"
11007
+ ]){
11008
+ const value = eventWithErrorDetails[property];
11009
+ if (void 0 !== value) details[property] = value;
11010
+ }
11011
+ if (eventWithErrorDetails.error instanceof Error) details.error = serializeError(eventWithErrorDetails.error);
11012
+ if (event.target) {
11013
+ const target = event.target;
11014
+ const targetDetails = {
11015
+ constructor: target.constructor.name
11016
+ };
11017
+ for (const property of [
11018
+ "url",
11019
+ "readyState",
11020
+ "protocol",
11021
+ "extensions",
11022
+ "binaryType",
11023
+ "bufferedAmount"
11024
+ ]){
11025
+ const value = target[property];
11026
+ if (void 0 !== value) targetDetails[property] = value;
11027
+ }
11028
+ details.target = targetDetails;
11029
+ }
11030
+ return details;
11031
+ }
11032
+ const error_getEventDetails = getEventDetails;
10987
11033
  function inspect(element) {
10988
11034
  return util_default().inspect(element, {
10989
11035
  colors: false,
@@ -10999,6 +11045,7 @@ var __webpack_exports__ = {};
10999
11045
  else if (anything.className) return `.${anything.className}`;
11000
11046
  return "(No HTML identifier available)";
11001
11047
  }
11048
+ if ("u" > typeof Event && anything instanceof Event) return inspect(error_getEventDetails(anything));
11002
11049
  return inspect(anything);
11003
11050
  }
11004
11051
  const util_pretty = pretty;
@@ -17605,6 +17652,7 @@ var __webpack_exports__ = {};
17605
17652
  const online = navigator.onLine;
17606
17653
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
17607
17654
  const closeEvent = this.lastCloseEvent;
17655
+ const socketError = this.lastSocketError;
17608
17656
  const diagnosticLines = [
17609
17657
  ` • cause: ${cause}`,
17610
17658
  ` • closeCode: ${null != (_ref = null == closeEvent ? void 0 : closeEvent.code) ? _ref : "undefined"}`,
@@ -17614,7 +17662,8 @@ var __webpack_exports__ = {};
17614
17662
  ` • unloaded: ${null != (_this_unloaded = this.unloaded) ? _this_unloaded : "undefined"}`,
17615
17663
  ` • userMediaLoaded: ${null != (_this_userMediaLoaded = this.userMediaLoaded) ? _this_userMediaLoaded : "undefined"}`,
17616
17664
  ` • userMediaLoading: ${this.userMediaLoading}`,
17617
- ` • wasClean: ${null != (_ref1 = null == closeEvent ? void 0 : closeEvent.wasClean) ? _ref1 : "undefined"}`
17665
+ ` • wasClean: ${null != (_ref1 = null == closeEvent ? void 0 : closeEvent.wasClean) ? _ref1 : "undefined"}`,
17666
+ ` • socketError: ${socketError ? util_pretty(socketError) : "undefined"}`
17618
17667
  ];
17619
17668
  const debugLine = [
17620
17669
  "🔎 Recorder: failConnection() diagnostic",
@@ -17623,6 +17672,7 @@ var __webpack_exports__ = {};
17623
17672
  this.options.logger.debug(debugLine);
17624
17673
  let explanation;
17625
17674
  if (online) if ("timeout" === cause) explanation = `The server at ${url2Connect} did not respond within ${this.options.timeouts.connection}ms, even though your device is online. This usually points to a firewall or proxy silently dropping the connection. Please try a different network. If the problem persists, contact us.`;
17675
+ else if ("error" === cause) explanation = `The WebSocket reported an error while connecting to ${url2Connect}. Details: ${util_pretty(null != socketError ? socketError : {})} Please check your internet connection and try again. If the problem persists, contact us.`;
17626
17676
  else {
17627
17677
  const closeSuffix = closeEvent ? ` (code ${closeEvent.code})` : "";
17628
17678
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
@@ -17635,7 +17685,10 @@ var __webpack_exports__ = {};
17635
17685
  const err = error_createError({
17636
17686
  message: "Unable to connect to the server",
17637
17687
  explanation,
17638
- options: this.options
17688
+ options: this.options,
17689
+ exc: socketError ? new Error("WebSocket connection error", {
17690
+ cause: socketError
17691
+ }) : void 0
17639
17692
  });
17640
17693
  this.emit("ERROR", {
17641
17694
  err
@@ -17721,6 +17774,7 @@ var __webpack_exports__ = {};
17721
17774
  this.connectionFailed = false;
17722
17775
  this.connectingStartedAt = Date.now();
17723
17776
  this.lastCloseEvent = void 0;
17777
+ this.lastSocketError = void 0;
17724
17778
  this.emit("CONNECTING");
17725
17779
  let url2Connect;
17726
17780
  try {
@@ -17751,6 +17805,9 @@ var __webpack_exports__ = {};
17751
17805
  wasClean: event.wasClean
17752
17806
  };
17753
17807
  });
17808
+ nativeSocket.addEventListener("error", (event)=>{
17809
+ this.lastSocketError = error_getEventDetails(event);
17810
+ });
17754
17811
  } catch (exc) {
17755
17812
  this.connecting = this.connected = false;
17756
17813
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -17832,7 +17889,25 @@ var __webpack_exports__ = {};
17832
17889
  }
17833
17890
  });
17834
17891
  this.stream.on("error", (err)=>{
17892
+ var _this_lastSocketError;
17893
+ if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
17894
+ else this.lastSocketError = serializeError(err);
17835
17895
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *error* event emitted: ${util_pretty(err)}`);
17896
+ if (!this.connected) return void this.failConnection({
17897
+ url2Connect,
17898
+ cause: "error"
17899
+ });
17900
+ const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
17901
+ cause: null != (_this_lastSocketError = this.lastSocketError) ? _this_lastSocketError : err
17902
+ });
17903
+ this.emit("ERROR", {
17904
+ err: error_createError({
17905
+ message: "WebSocket stream error",
17906
+ explanation: `The WebSocket stream emitted an error event. Details: ${util_pretty(err)}`,
17907
+ options: this.options,
17908
+ exc: streamError
17909
+ })
17910
+ });
17836
17911
  });
17837
17912
  this.stream.on("drain", ()=>{
17838
17913
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *drain* event emitted (should not happen!)`);
@@ -18581,7 +18656,7 @@ var __webpack_exports__ = {};
18581
18656
  return this.userMediaLoaded;
18582
18657
  }
18583
18658
  constructor(visuals, replay, options){
18584
- super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
18659
+ super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "lastSocketError", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
18585
18660
  this.visuals = visuals;
18586
18661
  this.replay = replay;
18587
18662
  this.facingMode = options.video.facingMode;
package/dist/esm/index.js CHANGED
@@ -3619,7 +3619,7 @@ const constants = {
3619
3619
  }
3620
3620
  };
3621
3621
  var package_namespaceObject = {
3622
- rE: "15.7.13"
3622
+ rE: "15.7.14"
3623
3623
  };
3624
3624
  function isAudioEnabled(options) {
3625
3625
  return Boolean(options.audio.enabled);
@@ -3631,6 +3631,52 @@ function setAudioEnabled(enabled, options) {
3631
3631
  function isAutoPauseEnabled(options) {
3632
3632
  return options.enableAutoPause && options.enablePause;
3633
3633
  }
3634
+ function getEventDetails(event) {
3635
+ const eventWithErrorDetails = event;
3636
+ const details = {
3637
+ constructor: event.constructor.name,
3638
+ type: event.type,
3639
+ isTrusted: event.isTrusted,
3640
+ bubbles: event.bubbles,
3641
+ cancelable: event.cancelable,
3642
+ composed: event.composed,
3643
+ defaultPrevented: event.defaultPrevented,
3644
+ eventPhase: event.eventPhase,
3645
+ timeStamp: event.timeStamp,
3646
+ returnValue: eventWithErrorDetails.returnValue,
3647
+ cancelBubble: eventWithErrorDetails.cancelBubble
3648
+ };
3649
+ for (const property of [
3650
+ "message",
3651
+ "filename",
3652
+ "lineno",
3653
+ "colno"
3654
+ ]){
3655
+ const value = eventWithErrorDetails[property];
3656
+ if (void 0 !== value) details[property] = value;
3657
+ }
3658
+ if (eventWithErrorDetails.error instanceof Error) details.error = serializeError(eventWithErrorDetails.error);
3659
+ if (event.target) {
3660
+ const target = event.target;
3661
+ const targetDetails = {
3662
+ constructor: target.constructor.name
3663
+ };
3664
+ for (const property of [
3665
+ "url",
3666
+ "readyState",
3667
+ "protocol",
3668
+ "extensions",
3669
+ "binaryType",
3670
+ "bufferedAmount"
3671
+ ]){
3672
+ const value = target[property];
3673
+ if (void 0 !== value) targetDetails[property] = value;
3674
+ }
3675
+ details.target = targetDetails;
3676
+ }
3677
+ return details;
3678
+ }
3679
+ const error_getEventDetails = getEventDetails;
3634
3680
  const util = __webpack_require__("Sy");
3635
3681
  var util_default = /*#__PURE__*/ __webpack_require__.n(util);
3636
3682
  function inspect(element) {
@@ -3648,6 +3694,7 @@ function pretty(anything) {
3648
3694
  else if (anything.className) return `.${anything.className}`;
3649
3695
  return "(No HTML identifier available)";
3650
3696
  }
3697
+ if ("u" > typeof Event && anything instanceof Event) return inspect(error_getEventDetails(anything));
3651
3698
  return inspect(anything);
3652
3699
  }
3653
3700
  const util_pretty = pretty;
@@ -6627,6 +6674,7 @@ class Recorder extends util_Despot {
6627
6674
  const online = navigator.onLine;
6628
6675
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
6629
6676
  const closeEvent = this.lastCloseEvent;
6677
+ const socketError = this.lastSocketError;
6630
6678
  const diagnosticLines = [
6631
6679
  ` • cause: ${cause}`,
6632
6680
  ` • closeCode: ${closeEvent?.code ?? "undefined"}`,
@@ -6636,7 +6684,8 @@ class Recorder extends util_Despot {
6636
6684
  ` • unloaded: ${this.unloaded ?? "undefined"}`,
6637
6685
  ` • userMediaLoaded: ${this.userMediaLoaded ?? "undefined"}`,
6638
6686
  ` • userMediaLoading: ${this.userMediaLoading}`,
6639
- ` • wasClean: ${closeEvent?.wasClean ?? "undefined"}`
6687
+ ` • wasClean: ${closeEvent?.wasClean ?? "undefined"}`,
6688
+ ` • socketError: ${socketError ? util_pretty(socketError) : "undefined"}`
6640
6689
  ];
6641
6690
  const debugLine = [
6642
6691
  "🔎 Recorder: failConnection() diagnostic",
@@ -6645,6 +6694,7 @@ class Recorder extends util_Despot {
6645
6694
  this.options.logger.debug(debugLine);
6646
6695
  let explanation;
6647
6696
  if (online) if ("timeout" === cause) explanation = `The server at ${url2Connect} did not respond within ${this.options.timeouts.connection}ms, even though your device is online. This usually points to a firewall or proxy silently dropping the connection. Please try a different network. If the problem persists, contact us.`;
6697
+ else if ("error" === cause) explanation = `The WebSocket reported an error while connecting to ${url2Connect}. Details: ${util_pretty(socketError ?? {})} Please check your internet connection and try again. If the problem persists, contact us.`;
6648
6698
  else {
6649
6699
  const closeSuffix = closeEvent ? ` (code ${closeEvent.code})` : "";
6650
6700
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
@@ -6657,7 +6707,10 @@ class Recorder extends util_Despot {
6657
6707
  const err = error_createError({
6658
6708
  message: "Unable to connect to the server",
6659
6709
  explanation,
6660
- options: this.options
6710
+ options: this.options,
6711
+ exc: socketError ? new Error("WebSocket connection error", {
6712
+ cause: socketError
6713
+ }) : void 0
6661
6714
  });
6662
6715
  this.emit("ERROR", {
6663
6716
  err
@@ -6742,6 +6795,7 @@ class Recorder extends util_Despot {
6742
6795
  this.connectionFailed = false;
6743
6796
  this.connectingStartedAt = Date.now();
6744
6797
  this.lastCloseEvent = void 0;
6798
+ this.lastSocketError = void 0;
6745
6799
  this.emit("CONNECTING");
6746
6800
  let url2Connect;
6747
6801
  try {
@@ -6772,6 +6826,9 @@ class Recorder extends util_Despot {
6772
6826
  wasClean: event.wasClean
6773
6827
  };
6774
6828
  });
6829
+ nativeSocket.addEventListener("error", (event)=>{
6830
+ this.lastSocketError = error_getEventDetails(event);
6831
+ });
6775
6832
  } catch (exc) {
6776
6833
  this.connecting = this.connected = false;
6777
6834
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -6852,7 +6909,24 @@ class Recorder extends util_Despot {
6852
6909
  }
6853
6910
  });
6854
6911
  this.stream.on("error", (err)=>{
6912
+ if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
6913
+ else this.lastSocketError = serializeError(err);
6855
6914
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *error* event emitted: ${util_pretty(err)}`);
6915
+ if (!this.connected) return void this.failConnection({
6916
+ url2Connect,
6917
+ cause: "error"
6918
+ });
6919
+ const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
6920
+ cause: this.lastSocketError ?? err
6921
+ });
6922
+ this.emit("ERROR", {
6923
+ err: error_createError({
6924
+ message: "WebSocket stream error",
6925
+ explanation: `The WebSocket stream emitted an error event. Details: ${util_pretty(err)}`,
6926
+ options: this.options,
6927
+ exc: streamError
6928
+ })
6929
+ });
6856
6930
  });
6857
6931
  this.stream.on("drain", ()=>{
6858
6932
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *drain* event emitted (should not happen!)`);
@@ -7586,7 +7660,7 @@ class Recorder extends util_Despot {
7586
7660
  return this.userMediaLoaded;
7587
7661
  }
7588
7662
  constructor(visuals, replay, options){
7589
- super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
7663
+ super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "lastSocketError", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
7590
7664
  this.visuals = visuals;
7591
7665
  this.replay = replay;
7592
7666
  this.facingMode = options.video.facingMode;
@@ -0,0 +1,2 @@
1
+ declare function getEventDetails(event: Event): Record<string, unknown>;
2
+ export default getEventDetails;
@@ -45,6 +45,7 @@ declare class Recorder extends Despot {
45
45
  private waitingTime?;
46
46
  private connectingStartedAt?;
47
47
  private lastCloseEvent?;
48
+ private lastSocketError?;
48
49
  private pingInterval?;
49
50
  private frame?;
50
51
  private recordingBuffer?;
package/dist/umd/index.js CHANGED
@@ -1581,7 +1581,7 @@
1581
1581
  return intrinsic;
1582
1582
  };
1583
1583
  },
1584
- r (module1) {
1584
+ rX (module1) {
1585
1585
  module1.exports = Emitter;
1586
1586
  function Emitter(obj) {
1587
1587
  if (obj) return mixin(obj);
@@ -1838,7 +1838,7 @@
1838
1838
  xF (module1, __unused_rspack_exports, __webpack_require__) {
1839
1839
  "use strict";
1840
1840
  var document1 = __webpack_require__("g");
1841
- var Event = __webpack_require__("cE");
1841
+ var Event1 = __webpack_require__("cE");
1842
1842
  var Keys = __webpack_require__("Dy");
1843
1843
  module1.exports = Visibility;
1844
1844
  function Visibility() {
@@ -1846,7 +1846,7 @@
1846
1846
  if (!keys) return noopShim();
1847
1847
  return {
1848
1848
  visible: visible,
1849
- onChange: Event(listen)
1849
+ onChange: Event1(listen)
1850
1850
  };
1851
1851
  function visible() {
1852
1852
  return !document1[keys.hidden];
@@ -4874,8 +4874,8 @@
4874
4874
  } : null;
4875
4875
  },
4876
4876
  Ne (module1) {
4877
- module1.exports = Event;
4878
- function Event() {
4877
+ module1.exports = Event1;
4878
+ function Event1() {
4879
4879
  var listeners = [];
4880
4880
  return {
4881
4881
  broadcast: broadcast,
@@ -4895,10 +4895,10 @@
4895
4895
  }
4896
4896
  },
4897
4897
  cE (module1, __unused_rspack_exports, __webpack_require__) {
4898
- var Event = __webpack_require__("Ne");
4898
+ var Event1 = __webpack_require__("Ne");
4899
4899
  module1.exports = Source;
4900
4900
  function Source(broadcaster) {
4901
- var tuple = Event();
4901
+ var tuple = Event1();
4902
4902
  broadcaster(tuple.broadcast);
4903
4903
  return tuple.listen;
4904
4904
  }
@@ -6789,7 +6789,7 @@
6789
6789
  return fn;
6790
6790
  };
6791
6791
  },
6792
- x5 (module1, __unused_rspack_exports, __webpack_require__) {
6792
+ x (module1, __unused_rspack_exports, __webpack_require__) {
6793
6793
  "use strict";
6794
6794
  var inspect = __webpack_require__("L");
6795
6795
  var $TypeError = __webpack_require__("N");
@@ -6950,7 +6950,7 @@
6950
6950
  "use strict";
6951
6951
  var $TypeError = __webpack_require__("N");
6952
6952
  var inspect = __webpack_require__("L");
6953
- var getSideChannelList = __webpack_require__("x5");
6953
+ var getSideChannelList = __webpack_require__("x");
6954
6954
  var getSideChannelMap = __webpack_require__("J");
6955
6955
  var getSideChannelWeakMap = __webpack_require__("c");
6956
6956
  var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
@@ -7047,7 +7047,7 @@
7047
7047
  console.warn('Using browser-only version of superagent in non-browser environment');
7048
7048
  root = void 0;
7049
7049
  } else root = self;
7050
- const Emitter = __webpack_require__("r");
7050
+ const Emitter = __webpack_require__("rX");
7051
7051
  const safeStringify = __webpack_require__("X");
7052
7052
  const qs = __webpack_require__("b");
7053
7053
  const RequestBase = __webpack_require__("d");
@@ -10976,7 +10976,7 @@
10976
10976
  var client = __webpack_require__("Q");
10977
10977
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10978
10978
  var package_namespaceObject = {
10979
- rE: "15.7.13"
10979
+ rE: "15.7.14"
10980
10980
  };
10981
10981
  function isAudioEnabled(options) {
10982
10982
  return Boolean(options.audio.enabled);
@@ -10990,6 +10990,52 @@
10990
10990
  }
10991
10991
  var util = __webpack_require__("S");
10992
10992
  var util_default = /*#__PURE__*/ __webpack_require__.n(util);
10993
+ function getEventDetails(event) {
10994
+ const eventWithErrorDetails = event;
10995
+ const details = {
10996
+ constructor: event.constructor.name,
10997
+ type: event.type,
10998
+ isTrusted: event.isTrusted,
10999
+ bubbles: event.bubbles,
11000
+ cancelable: event.cancelable,
11001
+ composed: event.composed,
11002
+ defaultPrevented: event.defaultPrevented,
11003
+ eventPhase: event.eventPhase,
11004
+ timeStamp: event.timeStamp,
11005
+ returnValue: eventWithErrorDetails.returnValue,
11006
+ cancelBubble: eventWithErrorDetails.cancelBubble
11007
+ };
11008
+ for (const property of [
11009
+ "message",
11010
+ "filename",
11011
+ "lineno",
11012
+ "colno"
11013
+ ]){
11014
+ const value = eventWithErrorDetails[property];
11015
+ if (void 0 !== value) details[property] = value;
11016
+ }
11017
+ if (eventWithErrorDetails.error instanceof Error) details.error = serializeError(eventWithErrorDetails.error);
11018
+ if (event.target) {
11019
+ const target = event.target;
11020
+ const targetDetails = {
11021
+ constructor: target.constructor.name
11022
+ };
11023
+ for (const property of [
11024
+ "url",
11025
+ "readyState",
11026
+ "protocol",
11027
+ "extensions",
11028
+ "binaryType",
11029
+ "bufferedAmount"
11030
+ ]){
11031
+ const value = target[property];
11032
+ if (void 0 !== value) targetDetails[property] = value;
11033
+ }
11034
+ details.target = targetDetails;
11035
+ }
11036
+ return details;
11037
+ }
11038
+ const error_getEventDetails = getEventDetails;
10993
11039
  function inspect(element) {
10994
11040
  return util_default().inspect(element, {
10995
11041
  colors: false,
@@ -11005,6 +11051,7 @@
11005
11051
  else if (anything.className) return `.${anything.className}`;
11006
11052
  return "(No HTML identifier available)";
11007
11053
  }
11054
+ if ("u" > typeof Event && anything instanceof Event) return inspect(error_getEventDetails(anything));
11008
11055
  return inspect(anything);
11009
11056
  }
11010
11057
  const util_pretty = pretty;
@@ -17265,6 +17312,7 @@
17265
17312
  waitingTime;
17266
17313
  connectingStartedAt;
17267
17314
  lastCloseEvent;
17315
+ lastSocketError;
17268
17316
  pingInterval;
17269
17317
  frame;
17270
17318
  recordingBuffer;
@@ -17376,6 +17424,7 @@
17376
17424
  const online = navigator.onLine;
17377
17425
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
17378
17426
  const closeEvent = this.lastCloseEvent;
17427
+ const socketError = this.lastSocketError;
17379
17428
  const diagnosticLines = [
17380
17429
  ` • cause: ${cause}`,
17381
17430
  ` • closeCode: ${closeEvent?.code ?? "undefined"}`,
@@ -17385,7 +17434,8 @@
17385
17434
  ` • unloaded: ${this.unloaded ?? "undefined"}`,
17386
17435
  ` • userMediaLoaded: ${this.userMediaLoaded ?? "undefined"}`,
17387
17436
  ` • userMediaLoading: ${this.userMediaLoading}`,
17388
- ` • wasClean: ${closeEvent?.wasClean ?? "undefined"}`
17437
+ ` • wasClean: ${closeEvent?.wasClean ?? "undefined"}`,
17438
+ ` • socketError: ${socketError ? util_pretty(socketError) : "undefined"}`
17389
17439
  ];
17390
17440
  const debugLine = [
17391
17441
  "🔎 Recorder: failConnection() diagnostic",
@@ -17394,6 +17444,7 @@
17394
17444
  this.options.logger.debug(debugLine);
17395
17445
  let explanation;
17396
17446
  if (online) if ("timeout" === cause) explanation = `The server at ${url2Connect} did not respond within ${this.options.timeouts.connection}ms, even though your device is online. This usually points to a firewall or proxy silently dropping the connection. Please try a different network. If the problem persists, contact us.`;
17447
+ else if ("error" === cause) explanation = `The WebSocket reported an error while connecting to ${url2Connect}. Details: ${util_pretty(socketError ?? {})} Please check your internet connection and try again. If the problem persists, contact us.`;
17397
17448
  else {
17398
17449
  const closeSuffix = closeEvent ? ` (code ${closeEvent.code})` : "";
17399
17450
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
@@ -17406,7 +17457,10 @@
17406
17457
  const err = error_createError({
17407
17458
  message: "Unable to connect to the server",
17408
17459
  explanation,
17409
- options: this.options
17460
+ options: this.options,
17461
+ exc: socketError ? new Error("WebSocket connection error", {
17462
+ cause: socketError
17463
+ }) : void 0
17410
17464
  });
17411
17465
  this.emit("ERROR", {
17412
17466
  err
@@ -17491,6 +17545,7 @@
17491
17545
  this.connectionFailed = false;
17492
17546
  this.connectingStartedAt = Date.now();
17493
17547
  this.lastCloseEvent = void 0;
17548
+ this.lastSocketError = void 0;
17494
17549
  this.emit("CONNECTING");
17495
17550
  let url2Connect;
17496
17551
  try {
@@ -17521,6 +17576,9 @@
17521
17576
  wasClean: event.wasClean
17522
17577
  };
17523
17578
  });
17579
+ nativeSocket.addEventListener("error", (event)=>{
17580
+ this.lastSocketError = error_getEventDetails(event);
17581
+ });
17524
17582
  } catch (exc) {
17525
17583
  this.connecting = this.connected = false;
17526
17584
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -17601,7 +17659,24 @@
17601
17659
  }
17602
17660
  });
17603
17661
  this.stream.on("error", (err)=>{
17662
+ if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
17663
+ else this.lastSocketError = serializeError(err);
17604
17664
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *error* event emitted: ${util_pretty(err)}`);
17665
+ if (!this.connected) return void this.failConnection({
17666
+ url2Connect,
17667
+ cause: "error"
17668
+ });
17669
+ const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
17670
+ cause: this.lastSocketError ?? err
17671
+ });
17672
+ this.emit("ERROR", {
17673
+ err: error_createError({
17674
+ message: "WebSocket stream error",
17675
+ explanation: `The WebSocket stream emitted an error event. Details: ${util_pretty(err)}`,
17676
+ options: this.options,
17677
+ exc: streamError
17678
+ })
17679
+ });
17605
17680
  });
17606
17681
  this.stream.on("drain", ()=>{
17607
17682
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *drain* event emitted (should not happen!)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "15.7.13",
3
+ "version": "15.7.14",
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",