videomail-client 15.7.0 → 15.7.2

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.
@@ -10932,7 +10932,7 @@ var __webpack_exports__ = {};
10932
10932
  var client = __webpack_require__(5734);
10933
10933
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10934
10934
  var package_namespaceObject = {
10935
- rE: "15.7.0"
10935
+ rE: "15.7.2"
10936
10936
  };
10937
10937
  function isAudioEnabled(options) {
10938
10938
  return Boolean(options.audio.enabled);
@@ -17539,17 +17539,30 @@ var __webpack_exports__ = {};
17539
17539
  this.connectionTimeout = void 0;
17540
17540
  }
17541
17541
  failConnection(params) {
17542
+ var _ref, _ref1;
17542
17543
  if (this.connectionFailed || this.connected || this.unloaded) return;
17543
17544
  this.connectionFailed = true;
17544
17545
  this.connecting = false;
17545
17546
  this.clearConnectionTimeout();
17547
+ const { url2Connect, cause } = params;
17548
+ const online = navigator.onLine;
17549
+ const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
17550
+ const closeEvent = this.lastCloseEvent;
17551
+ this.options.logger.debug(`Recorder: failConnection() diagnostic - cause=${cause}, online=${online}, elapsedMs=${null != elapsedMs ? elapsedMs : "unknown"}, closeCode=${null != (_ref = null == closeEvent ? void 0 : closeEvent.code) ? _ref : "none"}, closeReason=${(null == closeEvent ? void 0 : closeEvent.reason) || "none"}, wasClean=${null != (_ref1 = null == closeEvent ? void 0 : closeEvent.wasClean) ? _ref1 : "unknown"}`);
17552
+ let explanation;
17553
+ 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.`;
17554
+ else {
17555
+ const closeSuffix = closeEvent ? ` (close code ${closeEvent.code})` : "";
17556
+ explanation = `The connection to ${url2Connect} was refused or could not be reached${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
17557
+ }
17558
+ else explanation = "Your device appears to be offline. Please check your internet connection and try again.";
17546
17559
  if (this.stream) {
17547
17560
  this.stream.destroy();
17548
17561
  this.stream = void 0;
17549
17562
  }
17550
17563
  const err = error_createError({
17551
17564
  message: "Unable to connect to the server",
17552
- explanation: params.explanation,
17565
+ explanation,
17553
17566
  options: this.options
17554
17567
  });
17555
17568
  this.emit("ERROR", {
@@ -17629,6 +17642,8 @@ var __webpack_exports__ = {};
17629
17642
  if (!this.connected) {
17630
17643
  this.connecting = true;
17631
17644
  this.connectionFailed = false;
17645
+ this.connectingStartedAt = Date.now();
17646
+ this.lastCloseEvent = void 0;
17632
17647
  this.emit("CONNECTING");
17633
17648
  let url2Connect;
17634
17649
  try {
@@ -17652,6 +17667,13 @@ var __webpack_exports__ = {};
17652
17667
  let nativeSocket;
17653
17668
  try {
17654
17669
  nativeSocket = new WebSocket(url2Connect);
17670
+ nativeSocket.addEventListener("close", (event)=>{
17671
+ this.lastCloseEvent = {
17672
+ code: event.code,
17673
+ reason: event.reason,
17674
+ wasClean: event.wasClean
17675
+ };
17676
+ });
17655
17677
  } catch (exc) {
17656
17678
  this.connecting = this.connected = false;
17657
17679
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -17687,7 +17709,7 @@ var __webpack_exports__ = {};
17687
17709
  this.connectionTimeout = window.setTimeout(()=>{
17688
17710
  this.failConnection({
17689
17711
  url2Connect,
17690
- explanation: `The server at ${url2Connect} did not respond within ${connectionTimeoutMs}ms. Please check your internet connection and try again. If the problem persists, contact us.`
17712
+ cause: "timeout"
17691
17713
  });
17692
17714
  }, connectionTimeoutMs);
17693
17715
  this.stream.on("close", ()=>{
@@ -17697,7 +17719,7 @@ var __webpack_exports__ = {};
17697
17719
  this.connecting = this.connected = false;
17698
17720
  if (neverConnected) this.failConnection({
17699
17721
  url2Connect,
17700
- explanation: `The connection to ${url2Connect} was refused or could not be reached. Please check your internet connection and try again. If the problem persists, contact us.`
17722
+ cause: "closed"
17701
17723
  });
17702
17724
  else if (this.userMediaLoaded) this.initSocket();
17703
17725
  });
@@ -18482,7 +18504,7 @@ var __webpack_exports__ = {};
18482
18504
  return this.userMediaLoaded;
18483
18505
  }
18484
18506
  constructor(visuals, replay, options){
18485
- 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, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
18507
+ 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);
18486
18508
  this.visuals = visuals;
18487
18509
  this.replay = replay;
18488
18510
  this.facingMode = options.video.facingMode;
package/dist/esm/index.js CHANGED
@@ -3620,7 +3620,7 @@ const constants = {
3620
3620
  }
3621
3621
  };
3622
3622
  var package_namespaceObject = {
3623
- rE: "15.7.0"
3623
+ rE: "15.7.2"
3624
3624
  };
3625
3625
  function isAudioEnabled(options) {
3626
3626
  return Boolean(options.audio.enabled);
@@ -6606,13 +6606,25 @@ class Recorder extends util_Despot {
6606
6606
  this.connectionFailed = true;
6607
6607
  this.connecting = false;
6608
6608
  this.clearConnectionTimeout();
6609
+ const { url2Connect, cause } = params;
6610
+ const online = navigator.onLine;
6611
+ const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
6612
+ const closeEvent = this.lastCloseEvent;
6613
+ this.options.logger.debug(`Recorder: failConnection() diagnostic - cause=${cause}, online=${online}, elapsedMs=${elapsedMs ?? "unknown"}, closeCode=${closeEvent?.code ?? "none"}, closeReason=${closeEvent?.reason || "none"}, wasClean=${closeEvent?.wasClean ?? "unknown"}`);
6614
+ let explanation;
6615
+ 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.`;
6616
+ else {
6617
+ const closeSuffix = closeEvent ? ` (close code ${closeEvent.code})` : "";
6618
+ explanation = `The connection to ${url2Connect} was refused or could not be reached${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
6619
+ }
6620
+ else explanation = "Your device appears to be offline. Please check your internet connection and try again.";
6609
6621
  if (this.stream) {
6610
6622
  this.stream.destroy();
6611
6623
  this.stream = void 0;
6612
6624
  }
6613
6625
  const err = error_createError({
6614
6626
  message: "Unable to connect to the server",
6615
- explanation: params.explanation,
6627
+ explanation,
6616
6628
  options: this.options
6617
6629
  });
6618
6630
  this.emit("ERROR", {
@@ -6691,6 +6703,8 @@ class Recorder extends util_Despot {
6691
6703
  if (!this.connected) {
6692
6704
  this.connecting = true;
6693
6705
  this.connectionFailed = false;
6706
+ this.connectingStartedAt = Date.now();
6707
+ this.lastCloseEvent = void 0;
6694
6708
  this.emit("CONNECTING");
6695
6709
  let url2Connect;
6696
6710
  try {
@@ -6714,6 +6728,13 @@ class Recorder extends util_Despot {
6714
6728
  let nativeSocket;
6715
6729
  try {
6716
6730
  nativeSocket = new WebSocket(url2Connect);
6731
+ nativeSocket.addEventListener("close", (event)=>{
6732
+ this.lastCloseEvent = {
6733
+ code: event.code,
6734
+ reason: event.reason,
6735
+ wasClean: event.wasClean
6736
+ };
6737
+ });
6717
6738
  } catch (exc) {
6718
6739
  this.connecting = this.connected = false;
6719
6740
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -6749,7 +6770,7 @@ class Recorder extends util_Despot {
6749
6770
  this.connectionTimeout = window.setTimeout(()=>{
6750
6771
  this.failConnection({
6751
6772
  url2Connect,
6752
- explanation: `The server at ${url2Connect} did not respond within ${connectionTimeoutMs}ms. Please check your internet connection and try again. If the problem persists, contact us.`
6773
+ cause: "timeout"
6753
6774
  });
6754
6775
  }, connectionTimeoutMs);
6755
6776
  this.stream.on("close", ()=>{
@@ -6759,7 +6780,7 @@ class Recorder extends util_Despot {
6759
6780
  this.connecting = this.connected = false;
6760
6781
  if (neverConnected) this.failConnection({
6761
6782
  url2Connect,
6762
- explanation: `The connection to ${url2Connect} was refused or could not be reached. Please check your internet connection and try again. If the problem persists, contact us.`
6783
+ cause: "closed"
6763
6784
  });
6764
6785
  else if (this.userMediaLoaded) this.initSocket();
6765
6786
  });
@@ -7528,7 +7549,7 @@ class Recorder extends util_Despot {
7528
7549
  return this.userMediaLoaded;
7529
7550
  }
7530
7551
  constructor(visuals, replay, options){
7531
- 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, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
7552
+ 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);
7532
7553
  this.visuals = visuals;
7533
7554
  this.replay = replay;
7534
7555
  this.facingMode = options.video.facingMode;
@@ -31,9 +31,12 @@ export interface Videomail {
31
31
  dateCreatedServerPretty: string;
32
32
  dateUpdated?: number;
33
33
  dateUpdatedServerPretty?: string;
34
+ expired?: boolean;
34
35
  expiresAfter: number;
35
36
  expiresAfterIso: string;
36
37
  expiresAfterServerPretty: string;
38
+ orphaned?: boolean;
39
+ permanent?: boolean;
37
40
  format?: VideoFormat;
38
41
  height?: number | undefined;
39
42
  width?: number | undefined;
@@ -67,9 +67,12 @@ declare class Form extends Despot {
67
67
  dateCreatedServerPretty?: string;
68
68
  dateUpdated?: number;
69
69
  dateUpdatedServerPretty?: string;
70
+ expired?: boolean;
70
71
  expiresAfter?: number;
71
72
  expiresAfterIso?: string;
72
73
  expiresAfterServerPretty?: string;
74
+ orphaned?: boolean;
75
+ permanent?: boolean;
73
76
  format?: {
74
77
  [x: string]: string | number | {
75
78
  [x: string]: string | undefined;
@@ -252,9 +255,12 @@ declare class Form extends Despot {
252
255
  dateCreatedServerPretty?: string;
253
256
  dateUpdated?: number;
254
257
  dateUpdatedServerPretty?: string;
258
+ expired?: boolean;
255
259
  expiresAfter?: number;
256
260
  expiresAfterIso?: string;
257
261
  expiresAfterServerPretty?: string;
262
+ orphaned?: boolean;
263
+ permanent?: boolean;
258
264
  format?: {
259
265
  [x: string]: string | number | {
260
266
  [x: string]: string | undefined;
@@ -43,6 +43,8 @@ declare class Recorder extends Despot {
43
43
  private built;
44
44
  private key?;
45
45
  private waitingTime?;
46
+ private connectingStartedAt?;
47
+ private lastCloseEvent?;
46
48
  private pingInterval?;
47
49
  private frame?;
48
50
  private recordingBuffer?;
package/dist/umd/index.js CHANGED
@@ -10938,7 +10938,7 @@
10938
10938
  var client = __webpack_require__(5734);
10939
10939
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10940
10940
  var package_namespaceObject = {
10941
- rE: "15.7.0"
10941
+ rE: "15.7.2"
10942
10942
  };
10943
10943
  function isAudioEnabled(options) {
10944
10944
  return Boolean(options.audio.enabled);
@@ -17206,6 +17206,8 @@
17206
17206
  built = false;
17207
17207
  key;
17208
17208
  waitingTime;
17209
+ connectingStartedAt;
17210
+ lastCloseEvent;
17209
17211
  pingInterval;
17210
17212
  frame;
17211
17213
  recordingBuffer;
@@ -17313,13 +17315,25 @@
17313
17315
  this.connectionFailed = true;
17314
17316
  this.connecting = false;
17315
17317
  this.clearConnectionTimeout();
17318
+ const { url2Connect, cause } = params;
17319
+ const online = navigator.onLine;
17320
+ const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
17321
+ const closeEvent = this.lastCloseEvent;
17322
+ this.options.logger.debug(`Recorder: failConnection() diagnostic - cause=${cause}, online=${online}, elapsedMs=${elapsedMs ?? "unknown"}, closeCode=${closeEvent?.code ?? "none"}, closeReason=${closeEvent?.reason || "none"}, wasClean=${closeEvent?.wasClean ?? "unknown"}`);
17323
+ let explanation;
17324
+ 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.`;
17325
+ else {
17326
+ const closeSuffix = closeEvent ? ` (close code ${closeEvent.code})` : "";
17327
+ explanation = `The connection to ${url2Connect} was refused or could not be reached${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
17328
+ }
17329
+ else explanation = "Your device appears to be offline. Please check your internet connection and try again.";
17316
17330
  if (this.stream) {
17317
17331
  this.stream.destroy();
17318
17332
  this.stream = void 0;
17319
17333
  }
17320
17334
  const err = error_createError({
17321
17335
  message: "Unable to connect to the server",
17322
- explanation: params.explanation,
17336
+ explanation,
17323
17337
  options: this.options
17324
17338
  });
17325
17339
  this.emit("ERROR", {
@@ -17398,6 +17412,8 @@
17398
17412
  if (!this.connected) {
17399
17413
  this.connecting = true;
17400
17414
  this.connectionFailed = false;
17415
+ this.connectingStartedAt = Date.now();
17416
+ this.lastCloseEvent = void 0;
17401
17417
  this.emit("CONNECTING");
17402
17418
  let url2Connect;
17403
17419
  try {
@@ -17421,6 +17437,13 @@
17421
17437
  let nativeSocket;
17422
17438
  try {
17423
17439
  nativeSocket = new WebSocket(url2Connect);
17440
+ nativeSocket.addEventListener("close", (event)=>{
17441
+ this.lastCloseEvent = {
17442
+ code: event.code,
17443
+ reason: event.reason,
17444
+ wasClean: event.wasClean
17445
+ };
17446
+ });
17424
17447
  } catch (exc) {
17425
17448
  this.connecting = this.connected = false;
17426
17449
  const diagnostic = error_getWebSocketDiagnostic(url2Connect);
@@ -17456,7 +17479,7 @@
17456
17479
  this.connectionTimeout = window.setTimeout(()=>{
17457
17480
  this.failConnection({
17458
17481
  url2Connect,
17459
- explanation: `The server at ${url2Connect} did not respond within ${connectionTimeoutMs}ms. Please check your internet connection and try again. If the problem persists, contact us.`
17482
+ cause: "timeout"
17460
17483
  });
17461
17484
  }, connectionTimeoutMs);
17462
17485
  this.stream.on("close", ()=>{
@@ -17466,7 +17489,7 @@
17466
17489
  this.connecting = this.connected = false;
17467
17490
  if (neverConnected) this.failConnection({
17468
17491
  url2Connect,
17469
- explanation: `The connection to ${url2Connect} was refused or could not be reached. Please check your internet connection and try again. If the problem persists, contact us.`
17492
+ cause: "closed"
17470
17493
  });
17471
17494
  else if (this.userMediaLoaded) this.initSocket();
17472
17495
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "15.7.0",
3
+ "version": "15.7.2",
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",