videomail-client 15.7.13 → 15.7.15

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.
@@ -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];
@@ -4404,7 +4404,7 @@ var __webpack_modules__ = {
4404
4404
  var abs = __webpack_require__("G");
4405
4405
  var floor = __webpack_require__("t");
4406
4406
  var max = __webpack_require__("u");
4407
- var min = __webpack_require__("Y");
4407
+ var min = __webpack_require__("Yx");
4408
4408
  var pow = __webpack_require__("Ik");
4409
4409
  var round = __webpack_require__("W");
4410
4410
  var sign = __webpack_require__("Xe");
@@ -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
  }
@@ -5280,7 +5280,7 @@ var __webpack_modules__ = {
5280
5280
  "use strict";
5281
5281
  module.exports = Math.max;
5282
5282
  },
5283
- Y (module) {
5283
+ Yx (module) {
5284
5284
  "use strict";
5285
5285
  module.exports = Math.min;
5286
5286
  },
@@ -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;
@@ -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.15"
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;
@@ -17006,6 +17053,18 @@ var __webpack_exports__ = {};
17006
17053
  return /bot|crawler|spider|headlesschrome|phantomjs|puppeteer|playwright/iu.test(userAgent);
17007
17054
  }
17008
17055
  const util_isAutomatedUserAgent = isAutomatedUserAgent;
17056
+ function summarize(title, contents) {
17057
+ const lines = Object.entries(contents).sort(([keyA], [keyB])=>keyA.localeCompare(keyB)).map(([key, value])=>{
17058
+ const formattedValue = void 0 === value ? "undefined" : "object" == typeof value ? util_pretty(value) : value;
17059
+ return ` • ${key}: ${formattedValue}`;
17060
+ });
17061
+ const line = [
17062
+ `🔎 ${title}`,
17063
+ ...lines
17064
+ ].join("\n");
17065
+ return line;
17066
+ }
17067
+ const util_summarize = summarize;
17009
17068
  function esm_define_property(obj, key, value) {
17010
17069
  if (key in obj) Object.defineProperty(obj, key, {
17011
17070
  value: value,
@@ -17596,7 +17655,6 @@ var __webpack_exports__ = {};
17596
17655
  this.connectionTimeout = void 0;
17597
17656
  }
17598
17657
  failConnection(params) {
17599
- var _ref, _this_unloaded, _this_userMediaLoaded, _ref1;
17600
17658
  if (this.connectionFailed || this.connected || this.unloaded) return;
17601
17659
  this.connectionFailed = true;
17602
17660
  this.connecting = false;
@@ -17605,24 +17663,25 @@ var __webpack_exports__ = {};
17605
17663
  const online = navigator.onLine;
17606
17664
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
17607
17665
  const closeEvent = this.lastCloseEvent;
17608
- const diagnosticLines = [
17609
- ` • cause: ${cause}`,
17610
- ` • closeCode: ${null != (_ref = null == closeEvent ? void 0 : closeEvent.code) ? _ref : "undefined"}`,
17611
- ` • closeReason: ${(null == closeEvent ? void 0 : closeEvent.reason) || "undefined"}`,
17612
- ` • elapsedMs: ${null != elapsedMs ? elapsedMs : "undefined"}`,
17613
- ` • online: ${online}`,
17614
- ` • unloaded: ${null != (_this_unloaded = this.unloaded) ? _this_unloaded : "undefined"}`,
17615
- ` • userMediaLoaded: ${null != (_this_userMediaLoaded = this.userMediaLoaded) ? _this_userMediaLoaded : "undefined"}`,
17616
- ` • userMediaLoading: ${this.userMediaLoading}`,
17617
- ` • wasClean: ${null != (_ref1 = null == closeEvent ? void 0 : closeEvent.wasClean) ? _ref1 : "undefined"}`
17618
- ];
17619
- const debugLine = [
17620
- "🔎 Recorder: failConnection() diagnostic",
17621
- ...diagnosticLines
17622
- ].join("\n");
17666
+ const socketError = this.lastSocketError;
17667
+ const contents = {
17668
+ cause,
17669
+ closeCode: null == closeEvent ? void 0 : closeEvent.code,
17670
+ closeReason: null == closeEvent ? void 0 : closeEvent.reason,
17671
+ elapsedMs,
17672
+ online,
17673
+ unloaded: this.unloaded,
17674
+ userMediaLoaded: this.userMediaLoaded,
17675
+ userMediaLoading: this.userMediaLoading,
17676
+ wasClean: null == closeEvent ? void 0 : closeEvent.wasClean,
17677
+ socketError,
17678
+ blocking: this.blocking
17679
+ };
17680
+ const debugLine = util_summarize("Recorder: failConnection() diagnostic", contents);
17623
17681
  this.options.logger.debug(debugLine);
17624
17682
  let explanation;
17625
17683
  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.`;
17684
+ else if ("error" === cause) explanation = `An error occurred while connecting to ${url2Connect}. Please check your internet connection and try again. If the problem persists, contact us.`;
17626
17685
  else {
17627
17686
  const closeSuffix = closeEvent ? ` (code ${closeEvent.code})` : "";
17628
17687
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
@@ -17635,7 +17694,10 @@ var __webpack_exports__ = {};
17635
17694
  const err = error_createError({
17636
17695
  message: "Unable to connect to the server",
17637
17696
  explanation,
17638
- options: this.options
17697
+ options: this.options,
17698
+ exc: socketError ? new Error("WebSocket connection error", {
17699
+ cause: socketError
17700
+ }) : void 0
17639
17701
  });
17640
17702
  this.emit("ERROR", {
17641
17703
  err
@@ -17721,6 +17783,7 @@ var __webpack_exports__ = {};
17721
17783
  this.connectionFailed = false;
17722
17784
  this.connectingStartedAt = Date.now();
17723
17785
  this.lastCloseEvent = void 0;
17786
+ this.lastSocketError = void 0;
17724
17787
  this.emit("CONNECTING");
17725
17788
  let url2Connect;
17726
17789
  try {
@@ -17751,6 +17814,9 @@ var __webpack_exports__ = {};
17751
17814
  wasClean: event.wasClean
17752
17815
  };
17753
17816
  });
17817
+ nativeSocket.addEventListener("error", (event)=>{
17818
+ this.lastSocketError = error_getEventDetails(event);
17819
+ });
17754
17820
  } catch (exc) {
17755
17821
  this.connecting = this.connected = false;
17756
17822
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -17790,11 +17856,17 @@ var __webpack_exports__ = {};
17790
17856
  });
17791
17857
  }, connectionTimeoutMs);
17792
17858
  this.stream.on("close", ()=>{
17793
- this.options.logger.debug(`${PIPE_SYMBOL}Stream has closed, connecting=${this.connecting}, connected=${this.connected}, userMediaLoaded=${this.userMediaLoaded}`);
17859
+ const debugLine = util_summarize(`${PIPE_SYMBOL}Stream has closed:`, {
17860
+ connecting: this.connecting,
17861
+ connected: this.connected,
17862
+ userMediaLoaded: this.userMediaLoaded,
17863
+ blocking: this.blocking
17864
+ });
17865
+ this.options.logger.debug(debugLine);
17794
17866
  const tryReconnect = this.connected && this.userMediaLoaded;
17795
17867
  this.connected = false;
17796
17868
  if (tryReconnect) this.initSocket();
17797
- else if (!this.connecting) window.setTimeout(()=>{
17869
+ else if (!this.connecting && !this.blocking) window.setTimeout(()=>{
17798
17870
  this.failConnection({
17799
17871
  url2Connect,
17800
17872
  cause: "closed"
@@ -17832,7 +17904,28 @@ var __webpack_exports__ = {};
17832
17904
  }
17833
17905
  });
17834
17906
  this.stream.on("error", (err)=>{
17835
- this.options.logger.debug(`${PIPE_SYMBOL}Stream *error* event emitted: ${util_pretty(err)}`);
17907
+ var _this_lastSocketError;
17908
+ if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
17909
+ else this.lastSocketError = serializeError(err);
17910
+ const debugLine = util_summarize(`${PIPE_SYMBOL}Stream *error* event emitted:`, {
17911
+ error: serializeError(err)
17912
+ });
17913
+ this.options.logger.debug(debugLine);
17914
+ if (!this.connected) return void this.failConnection({
17915
+ url2Connect,
17916
+ cause: "error"
17917
+ });
17918
+ const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
17919
+ cause: null != (_this_lastSocketError = this.lastSocketError) ? _this_lastSocketError : err
17920
+ });
17921
+ this.emit("ERROR", {
17922
+ err: error_createError({
17923
+ message: "WebSocket stream error",
17924
+ explanation: `The WebSocket stream emitted an error event. Details: ${util_pretty(err)}`,
17925
+ options: this.options,
17926
+ exc: streamError
17927
+ })
17928
+ });
17836
17929
  });
17837
17930
  this.stream.on("drain", ()=>{
17838
17931
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *drain* event emitted (should not happen!)`);
@@ -18000,8 +18093,10 @@ var __webpack_exports__ = {};
18000
18093
  executeCommand(command) {
18001
18094
  if (this.unloaded) return;
18002
18095
  try {
18003
- if (command.args) this.options.logger.debug(`Server commanded: ${command.command} with ${util_pretty(command.args)}`);
18004
- else this.options.logger.debug(`Server commanded: ${command.command}`);
18096
+ if (command.args) {
18097
+ const debugLine = util_summarize(`Server commanded: ${command.command} with:`, command.args);
18098
+ this.options.logger.debug(debugLine);
18099
+ } else this.options.logger.debug(`Server commanded: ${command.command}`);
18005
18100
  switch(command.command){
18006
18101
  case "ready":
18007
18102
  this.emit("SERVER_READY");
@@ -18581,7 +18676,7 @@ var __webpack_exports__ = {};
18581
18676
  return this.userMediaLoaded;
18582
18677
  }
18583
18678
  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);
18679
+ 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
18680
  this.visuals = visuals;
18586
18681
  this.replay = replay;
18587
18682
  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.15"
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;
@@ -6073,6 +6120,18 @@ function isAutomatedUserAgent(userAgent = navigator.userAgent) {
6073
6120
  return /bot|crawler|spider|headlesschrome|phantomjs|puppeteer|playwright/iu.test(userAgent);
6074
6121
  }
6075
6122
  const util_isAutomatedUserAgent = isAutomatedUserAgent;
6123
+ function summarize(title, contents) {
6124
+ const lines = Object.entries(contents).sort(([keyA], [keyB])=>keyA.localeCompare(keyB)).map(([key, value])=>{
6125
+ const formattedValue = void 0 === value ? "undefined" : "object" == typeof value ? util_pretty(value) : value;
6126
+ return ` • ${key}: ${formattedValue}`;
6127
+ });
6128
+ const line = [
6129
+ `🔎 ${title}`,
6130
+ ...lines
6131
+ ].join("\n");
6132
+ return line;
6133
+ }
6134
+ const util_summarize = summarize;
6076
6135
  function AudioRecorder_define_property(obj, key, value) {
6077
6136
  if (key in obj) Object.defineProperty(obj, key, {
6078
6137
  value: value,
@@ -6627,24 +6686,25 @@ class Recorder extends util_Despot {
6627
6686
  const online = navigator.onLine;
6628
6687
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
6629
6688
  const closeEvent = this.lastCloseEvent;
6630
- const diagnosticLines = [
6631
- ` • cause: ${cause}`,
6632
- ` • closeCode: ${closeEvent?.code ?? "undefined"}`,
6633
- ` • closeReason: ${closeEvent?.reason || "undefined"}`,
6634
- ` • elapsedMs: ${elapsedMs ?? "undefined"}`,
6635
- ` • online: ${online}`,
6636
- ` • unloaded: ${this.unloaded ?? "undefined"}`,
6637
- ` • userMediaLoaded: ${this.userMediaLoaded ?? "undefined"}`,
6638
- ` • userMediaLoading: ${this.userMediaLoading}`,
6639
- ` • wasClean: ${closeEvent?.wasClean ?? "undefined"}`
6640
- ];
6641
- const debugLine = [
6642
- "🔎 Recorder: failConnection() diagnostic",
6643
- ...diagnosticLines
6644
- ].join("\n");
6689
+ const socketError = this.lastSocketError;
6690
+ const contents = {
6691
+ cause,
6692
+ closeCode: closeEvent?.code,
6693
+ closeReason: closeEvent?.reason,
6694
+ elapsedMs,
6695
+ online,
6696
+ unloaded: this.unloaded,
6697
+ userMediaLoaded: this.userMediaLoaded,
6698
+ userMediaLoading: this.userMediaLoading,
6699
+ wasClean: closeEvent?.wasClean,
6700
+ socketError,
6701
+ blocking: this.blocking
6702
+ };
6703
+ const debugLine = util_summarize("Recorder: failConnection() diagnostic", contents);
6645
6704
  this.options.logger.debug(debugLine);
6646
6705
  let explanation;
6647
6706
  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.`;
6707
+ else if ("error" === cause) explanation = `An error occurred while connecting to ${url2Connect}. Please check your internet connection and try again. If the problem persists, contact us.`;
6648
6708
  else {
6649
6709
  const closeSuffix = closeEvent ? ` (code ${closeEvent.code})` : "";
6650
6710
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
@@ -6657,7 +6717,10 @@ class Recorder extends util_Despot {
6657
6717
  const err = error_createError({
6658
6718
  message: "Unable to connect to the server",
6659
6719
  explanation,
6660
- options: this.options
6720
+ options: this.options,
6721
+ exc: socketError ? new Error("WebSocket connection error", {
6722
+ cause: socketError
6723
+ }) : void 0
6661
6724
  });
6662
6725
  this.emit("ERROR", {
6663
6726
  err
@@ -6742,6 +6805,7 @@ class Recorder extends util_Despot {
6742
6805
  this.connectionFailed = false;
6743
6806
  this.connectingStartedAt = Date.now();
6744
6807
  this.lastCloseEvent = void 0;
6808
+ this.lastSocketError = void 0;
6745
6809
  this.emit("CONNECTING");
6746
6810
  let url2Connect;
6747
6811
  try {
@@ -6772,6 +6836,9 @@ class Recorder extends util_Despot {
6772
6836
  wasClean: event.wasClean
6773
6837
  };
6774
6838
  });
6839
+ nativeSocket.addEventListener("error", (event)=>{
6840
+ this.lastSocketError = error_getEventDetails(event);
6841
+ });
6775
6842
  } catch (exc) {
6776
6843
  this.connecting = this.connected = false;
6777
6844
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -6811,11 +6878,17 @@ class Recorder extends util_Despot {
6811
6878
  });
6812
6879
  }, connectionTimeoutMs);
6813
6880
  this.stream.on("close", ()=>{
6814
- this.options.logger.debug(`${PIPE_SYMBOL}Stream has closed, connecting=${this.connecting}, connected=${this.connected}, userMediaLoaded=${this.userMediaLoaded}`);
6881
+ const debugLine = util_summarize(`${PIPE_SYMBOL}Stream has closed:`, {
6882
+ connecting: this.connecting,
6883
+ connected: this.connected,
6884
+ userMediaLoaded: this.userMediaLoaded,
6885
+ blocking: this.blocking
6886
+ });
6887
+ this.options.logger.debug(debugLine);
6815
6888
  const tryReconnect = this.connected && this.userMediaLoaded;
6816
6889
  this.connected = false;
6817
6890
  if (tryReconnect) this.initSocket();
6818
- else if (!this.connecting) window.setTimeout(()=>{
6891
+ else if (!this.connecting && !this.blocking) window.setTimeout(()=>{
6819
6892
  this.failConnection({
6820
6893
  url2Connect,
6821
6894
  cause: "closed"
@@ -6852,7 +6925,27 @@ class Recorder extends util_Despot {
6852
6925
  }
6853
6926
  });
6854
6927
  this.stream.on("error", (err)=>{
6855
- this.options.logger.debug(`${PIPE_SYMBOL}Stream *error* event emitted: ${util_pretty(err)}`);
6928
+ if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
6929
+ else this.lastSocketError = serializeError(err);
6930
+ const debugLine = util_summarize(`${PIPE_SYMBOL}Stream *error* event emitted:`, {
6931
+ error: serializeError(err)
6932
+ });
6933
+ this.options.logger.debug(debugLine);
6934
+ if (!this.connected) return void this.failConnection({
6935
+ url2Connect,
6936
+ cause: "error"
6937
+ });
6938
+ const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
6939
+ cause: this.lastSocketError ?? err
6940
+ });
6941
+ this.emit("ERROR", {
6942
+ err: error_createError({
6943
+ message: "WebSocket stream error",
6944
+ explanation: `The WebSocket stream emitted an error event. Details: ${util_pretty(err)}`,
6945
+ options: this.options,
6946
+ exc: streamError
6947
+ })
6948
+ });
6856
6949
  });
6857
6950
  this.stream.on("drain", ()=>{
6858
6951
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *drain* event emitted (should not happen!)`);
@@ -7019,8 +7112,10 @@ class Recorder extends util_Despot {
7019
7112
  executeCommand(command) {
7020
7113
  if (this.unloaded) return;
7021
7114
  try {
7022
- if (command.args) this.options.logger.debug(`Server commanded: ${command.command} with ${util_pretty(command.args)}`);
7023
- else this.options.logger.debug(`Server commanded: ${command.command}`);
7115
+ if (command.args) {
7116
+ const debugLine = util_summarize(`Server commanded: ${command.command} with:`, command.args);
7117
+ this.options.logger.debug(debugLine);
7118
+ } else this.options.logger.debug(`Server commanded: ${command.command}`);
7024
7119
  switch(command.command){
7025
7120
  case "ready":
7026
7121
  this.emit("SERVER_READY");
@@ -7586,7 +7681,7 @@ class Recorder extends util_Despot {
7586
7681
  return this.userMediaLoaded;
7587
7682
  }
7588
7683
  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);
7684
+ 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
7685
  this.visuals = visuals;
7591
7686
  this.replay = replay;
7592
7687
  this.facingMode = options.video.facingMode;
@@ -1,5 +1,6 @@
1
1
  import { ErrorObject } from "serialize-error";
2
2
  export interface VideomailCommandArgs {
3
+ [key: string]: string | number | boolean | undefined | Record<string, unknown>;
3
4
  frame?: number;
4
5
  key?: string | undefined;
5
6
  err?: ErrorObject;
@@ -0,0 +1,2 @@
1
+ declare function getEventDetails(event: Event): Record<string, unknown>;
2
+ export default getEventDetails;
@@ -0,0 +1,3 @@
1
+ export type Contents = Record<string, string | number | boolean | undefined | Record<string, unknown>>;
2
+ declare function summarize(title: string, contents: Contents): string;
3
+ export default summarize;
@@ -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
@@ -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];
@@ -4410,7 +4410,7 @@
4410
4410
  var abs = __webpack_require__("G");
4411
4411
  var floor = __webpack_require__("t");
4412
4412
  var max = __webpack_require__("u");
4413
- var min = __webpack_require__("Y");
4413
+ var min = __webpack_require__("Yx");
4414
4414
  var pow = __webpack_require__("Ik");
4415
4415
  var round = __webpack_require__("W");
4416
4416
  var sign = __webpack_require__("Xe");
@@ -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
  }
@@ -5286,7 +5286,7 @@
5286
5286
  "use strict";
5287
5287
  module1.exports = Math.max;
5288
5288
  },
5289
- Y (module1) {
5289
+ Yx (module1) {
5290
5290
  "use strict";
5291
5291
  module1.exports = Math.min;
5292
5292
  },
@@ -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;
@@ -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.15"
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;
@@ -16771,6 +16818,18 @@
16771
16818
  return /bot|crawler|spider|headlesschrome|phantomjs|puppeteer|playwright/iu.test(userAgent);
16772
16819
  }
16773
16820
  const util_isAutomatedUserAgent = isAutomatedUserAgent;
16821
+ function summarize(title, contents) {
16822
+ const lines = Object.entries(contents).sort(([keyA], [keyB])=>keyA.localeCompare(keyB)).map(([key, value])=>{
16823
+ const formattedValue = void 0 === value ? "undefined" : "object" == typeof value ? util_pretty(value) : value;
16824
+ return ` • ${key}: ${formattedValue}`;
16825
+ });
16826
+ const line = [
16827
+ `🔎 ${title}`,
16828
+ ...lines
16829
+ ].join("\n");
16830
+ return line;
16831
+ }
16832
+ const util_summarize = summarize;
16774
16833
  function _define_property(obj, key, value) {
16775
16834
  if (key in obj) Object.defineProperty(obj, key, {
16776
16835
  value: value,
@@ -17265,6 +17324,7 @@
17265
17324
  waitingTime;
17266
17325
  connectingStartedAt;
17267
17326
  lastCloseEvent;
17327
+ lastSocketError;
17268
17328
  pingInterval;
17269
17329
  frame;
17270
17330
  recordingBuffer;
@@ -17376,24 +17436,25 @@
17376
17436
  const online = navigator.onLine;
17377
17437
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
17378
17438
  const closeEvent = this.lastCloseEvent;
17379
- const diagnosticLines = [
17380
- ` • cause: ${cause}`,
17381
- ` • closeCode: ${closeEvent?.code ?? "undefined"}`,
17382
- ` • closeReason: ${closeEvent?.reason || "undefined"}`,
17383
- ` • elapsedMs: ${elapsedMs ?? "undefined"}`,
17384
- ` • online: ${online}`,
17385
- ` • unloaded: ${this.unloaded ?? "undefined"}`,
17386
- ` • userMediaLoaded: ${this.userMediaLoaded ?? "undefined"}`,
17387
- ` • userMediaLoading: ${this.userMediaLoading}`,
17388
- ` • wasClean: ${closeEvent?.wasClean ?? "undefined"}`
17389
- ];
17390
- const debugLine = [
17391
- "🔎 Recorder: failConnection() diagnostic",
17392
- ...diagnosticLines
17393
- ].join("\n");
17439
+ const socketError = this.lastSocketError;
17440
+ const contents = {
17441
+ cause,
17442
+ closeCode: closeEvent?.code,
17443
+ closeReason: closeEvent?.reason,
17444
+ elapsedMs,
17445
+ online,
17446
+ unloaded: this.unloaded,
17447
+ userMediaLoaded: this.userMediaLoaded,
17448
+ userMediaLoading: this.userMediaLoading,
17449
+ wasClean: closeEvent?.wasClean,
17450
+ socketError,
17451
+ blocking: this.blocking
17452
+ };
17453
+ const debugLine = util_summarize("Recorder: failConnection() diagnostic", contents);
17394
17454
  this.options.logger.debug(debugLine);
17395
17455
  let explanation;
17396
17456
  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.`;
17457
+ else if ("error" === cause) explanation = `An error occurred while connecting to ${url2Connect}. Please check your internet connection and try again. If the problem persists, contact us.`;
17397
17458
  else {
17398
17459
  const closeSuffix = closeEvent ? ` (code ${closeEvent.code})` : "";
17399
17460
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
@@ -17406,7 +17467,10 @@
17406
17467
  const err = error_createError({
17407
17468
  message: "Unable to connect to the server",
17408
17469
  explanation,
17409
- options: this.options
17470
+ options: this.options,
17471
+ exc: socketError ? new Error("WebSocket connection error", {
17472
+ cause: socketError
17473
+ }) : void 0
17410
17474
  });
17411
17475
  this.emit("ERROR", {
17412
17476
  err
@@ -17491,6 +17555,7 @@
17491
17555
  this.connectionFailed = false;
17492
17556
  this.connectingStartedAt = Date.now();
17493
17557
  this.lastCloseEvent = void 0;
17558
+ this.lastSocketError = void 0;
17494
17559
  this.emit("CONNECTING");
17495
17560
  let url2Connect;
17496
17561
  try {
@@ -17521,6 +17586,9 @@
17521
17586
  wasClean: event.wasClean
17522
17587
  };
17523
17588
  });
17589
+ nativeSocket.addEventListener("error", (event)=>{
17590
+ this.lastSocketError = error_getEventDetails(event);
17591
+ });
17524
17592
  } catch (exc) {
17525
17593
  this.connecting = this.connected = false;
17526
17594
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -17560,11 +17628,17 @@
17560
17628
  });
17561
17629
  }, connectionTimeoutMs);
17562
17630
  this.stream.on("close", ()=>{
17563
- this.options.logger.debug(`${PIPE_SYMBOL}Stream has closed, connecting=${this.connecting}, connected=${this.connected}, userMediaLoaded=${this.userMediaLoaded}`);
17631
+ const debugLine = util_summarize(`${PIPE_SYMBOL}Stream has closed:`, {
17632
+ connecting: this.connecting,
17633
+ connected: this.connected,
17634
+ userMediaLoaded: this.userMediaLoaded,
17635
+ blocking: this.blocking
17636
+ });
17637
+ this.options.logger.debug(debugLine);
17564
17638
  const tryReconnect = this.connected && this.userMediaLoaded;
17565
17639
  this.connected = false;
17566
17640
  if (tryReconnect) this.initSocket();
17567
- else if (!this.connecting) window.setTimeout(()=>{
17641
+ else if (!this.connecting && !this.blocking) window.setTimeout(()=>{
17568
17642
  this.failConnection({
17569
17643
  url2Connect,
17570
17644
  cause: "closed"
@@ -17601,7 +17675,27 @@
17601
17675
  }
17602
17676
  });
17603
17677
  this.stream.on("error", (err)=>{
17604
- this.options.logger.debug(`${PIPE_SYMBOL}Stream *error* event emitted: ${util_pretty(err)}`);
17678
+ if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
17679
+ else this.lastSocketError = serializeError(err);
17680
+ const debugLine = util_summarize(`${PIPE_SYMBOL}Stream *error* event emitted:`, {
17681
+ error: serializeError(err)
17682
+ });
17683
+ this.options.logger.debug(debugLine);
17684
+ if (!this.connected) return void this.failConnection({
17685
+ url2Connect,
17686
+ cause: "error"
17687
+ });
17688
+ const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
17689
+ cause: this.lastSocketError ?? err
17690
+ });
17691
+ this.emit("ERROR", {
17692
+ err: error_createError({
17693
+ message: "WebSocket stream error",
17694
+ explanation: `The WebSocket stream emitted an error event. Details: ${util_pretty(err)}`,
17695
+ options: this.options,
17696
+ exc: streamError
17697
+ })
17698
+ });
17605
17699
  });
17606
17700
  this.stream.on("drain", ()=>{
17607
17701
  this.options.logger.debug(`${PIPE_SYMBOL}Stream *drain* event emitted (should not happen!)`);
@@ -17768,8 +17862,10 @@
17768
17862
  executeCommand(command) {
17769
17863
  if (this.unloaded) return;
17770
17864
  try {
17771
- if (command.args) this.options.logger.debug(`Server commanded: ${command.command} with ${util_pretty(command.args)}`);
17772
- else this.options.logger.debug(`Server commanded: ${command.command}`);
17865
+ if (command.args) {
17866
+ const debugLine = util_summarize(`Server commanded: ${command.command} with:`, command.args);
17867
+ this.options.logger.debug(debugLine);
17868
+ } else this.options.logger.debug(`Server commanded: ${command.command}`);
17773
17869
  switch(command.command){
17774
17870
  case "ready":
17775
17871
  this.emit("SERVER_READY");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "15.7.13",
3
+ "version": "15.7.15",
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",