videomail-client 15.8.2 → 15.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10972,7 +10972,7 @@ var __webpack_exports__ = {};
10972
10972
  var client = __webpack_require__("Q");
10973
10973
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10974
10974
  var package_namespaceObject = {
10975
- rE: "15.8.2"
10975
+ rE: "15.8.4"
10976
10976
  };
10977
10977
  function isAudioEnabled(options) {
10978
10978
  return Boolean(options.audio.enabled);
@@ -19684,6 +19684,12 @@ var __webpack_exports__ = {};
19684
19684
  window.clearTimeout(this.connectionTimeout);
19685
19685
  this.connectionTimeout = void 0;
19686
19686
  }
19687
+ discardSocket() {
19688
+ this.options.logger.debug("Recorder: discarding socket stream ...");
19689
+ const stream = this.stream;
19690
+ this.stream = void 0;
19691
+ if (stream && !stream.destroyed) stream.destroy();
19692
+ }
19687
19693
  isOnline() {
19688
19694
  return navigator.onLine;
19689
19695
  }
@@ -19726,10 +19732,7 @@ var __webpack_exports__ = {};
19726
19732
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
19727
19733
  }
19728
19734
  else explanation = "Your device appears to be offline. Please check your internet connection and try again.";
19729
- if (this.stream) {
19730
- this.stream.destroy();
19731
- this.stream = void 0;
19732
- }
19735
+ this.discardSocket();
19733
19736
  const err = error_createError({
19734
19737
  message: "Unable to connect to the server",
19735
19738
  explanation,
@@ -19813,8 +19816,12 @@ var __webpack_exports__ = {};
19813
19816
  this.recordingStats.waitingTime = this.waitingTime;
19814
19817
  }
19815
19818
  initSocket(cb) {
19816
- if (this.connected) return void (null == cb || cb());
19817
- if (this.connecting) return;
19819
+ if (this.connected) {
19820
+ this.options.logger.debug("Recorder: already **connected**. Not going to initialize a new WebSocket connection.");
19821
+ null == cb || cb();
19822
+ return;
19823
+ }
19824
+ if (this.connecting) return void this.options.logger.debug("Recorder: already **connecting**. Not going to initialize a new WebSocket connection.");
19818
19825
  if (util_isAutomatedUserAgent()) {
19819
19826
  this.connecting = false;
19820
19827
  this.options.logger.debug("Recorder: skipping web socket connection for an automated crawler");
@@ -20318,11 +20325,7 @@ var __webpack_exports__ = {};
20318
20325
  this.connecting = false;
20319
20326
  if (this.userMedia) this.userMedia.unloadRemainingEventListeners();
20320
20327
  if (this.submitting) ;
20321
- else if (this.stream) {
20322
- this.options.logger.debug("Recorder: destroying stream ...");
20323
- this.stream.destroy();
20324
- this.stream = void 0;
20325
- }
20328
+ else if (this.stream) this.discardSocket();
20326
20329
  this.unloaded = true;
20327
20330
  this.built = this.connecting = this.connected = false;
20328
20331
  }
package/dist/esm/index.js CHANGED
@@ -3620,7 +3620,7 @@ const constants = {
3620
3620
  }
3621
3621
  };
3622
3622
  var package_namespaceObject = {
3623
- rE: "15.8.2"
3623
+ rE: "15.8.4"
3624
3624
  };
3625
3625
  function isAudioEnabled(options) {
3626
3626
  return Boolean(options.audio.enabled);
@@ -6713,6 +6713,12 @@ class Recorder extends util_Despot {
6713
6713
  window.clearTimeout(this.connectionTimeout);
6714
6714
  this.connectionTimeout = void 0;
6715
6715
  }
6716
+ discardSocket() {
6717
+ this.options.logger.debug("Recorder: discarding socket stream ...");
6718
+ const stream = this.stream;
6719
+ this.stream = void 0;
6720
+ if (stream && !stream.destroyed) stream.destroy();
6721
+ }
6716
6722
  isOnline() {
6717
6723
  return navigator.onLine;
6718
6724
  }
@@ -6754,10 +6760,7 @@ class Recorder extends util_Despot {
6754
6760
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
6755
6761
  }
6756
6762
  else explanation = "Your device appears to be offline. Please check your internet connection and try again.";
6757
- if (this.stream) {
6758
- this.stream.destroy();
6759
- this.stream = void 0;
6760
- }
6763
+ this.discardSocket();
6761
6764
  const err = error_createError({
6762
6765
  message: "Unable to connect to the server",
6763
6766
  explanation,
@@ -6840,8 +6843,12 @@ class Recorder extends util_Despot {
6840
6843
  this.recordingStats.waitingTime = this.waitingTime;
6841
6844
  }
6842
6845
  initSocket(cb) {
6843
- if (this.connected) return void cb?.();
6844
- if (this.connecting) return;
6846
+ if (this.connected) {
6847
+ this.options.logger.debug("Recorder: already **connected**. Not going to initialize a new WebSocket connection.");
6848
+ cb?.();
6849
+ return;
6850
+ }
6851
+ if (this.connecting) return void this.options.logger.debug("Recorder: already **connecting**. Not going to initialize a new WebSocket connection.");
6845
6852
  if (util_isAutomatedUserAgent()) {
6846
6853
  this.connecting = false;
6847
6854
  this.options.logger.debug("Recorder: skipping web socket connection for an automated crawler");
@@ -7337,11 +7344,7 @@ class Recorder extends util_Despot {
7337
7344
  this.connecting = false;
7338
7345
  if (this.userMedia) this.userMedia.unloadRemainingEventListeners();
7339
7346
  if (this.submitting) ;
7340
- else if (this.stream) {
7341
- this.options.logger.debug("Recorder: destroying stream ...");
7342
- this.stream.destroy();
7343
- this.stream = void 0;
7344
- }
7347
+ else if (this.stream) this.discardSocket();
7345
7348
  this.unloaded = true;
7346
7349
  this.built = this.connecting = this.connected = false;
7347
7350
  }
@@ -60,6 +60,7 @@ declare class Recorder extends Despot {
60
60
  private onUserMediaReady;
61
61
  private clearRetryTimeout;
62
62
  private clearConnectionTimeout;
63
+ private discardSocket;
63
64
  private isOnline;
64
65
  private failConnection;
65
66
  private calculateFrameProgress;
package/dist/umd/index.js CHANGED
@@ -10978,7 +10978,7 @@
10978
10978
  var client = __webpack_require__("Q");
10979
10979
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10980
10980
  var package_namespaceObject = {
10981
- rE: "15.8.2"
10981
+ rE: "15.8.4"
10982
10982
  };
10983
10983
  function isAudioEnabled(options) {
10984
10984
  return Boolean(options.audio.enabled);
@@ -19462,6 +19462,12 @@
19462
19462
  window.clearTimeout(this.connectionTimeout);
19463
19463
  this.connectionTimeout = void 0;
19464
19464
  }
19465
+ discardSocket() {
19466
+ this.options.logger.debug("Recorder: discarding socket stream ...");
19467
+ const stream = this.stream;
19468
+ this.stream = void 0;
19469
+ if (stream && !stream.destroyed) stream.destroy();
19470
+ }
19465
19471
  isOnline() {
19466
19472
  return navigator.onLine;
19467
19473
  }
@@ -19503,10 +19509,7 @@
19503
19509
  explanation = `Connection to ${url2Connect} is closed${closeSuffix}. Please check your internet connection and try again. If the problem persists, contact us.`;
19504
19510
  }
19505
19511
  else explanation = "Your device appears to be offline. Please check your internet connection and try again.";
19506
- if (this.stream) {
19507
- this.stream.destroy();
19508
- this.stream = void 0;
19509
- }
19512
+ this.discardSocket();
19510
19513
  const err = error_createError({
19511
19514
  message: "Unable to connect to the server",
19512
19515
  explanation,
@@ -19589,8 +19592,12 @@
19589
19592
  this.recordingStats.waitingTime = this.waitingTime;
19590
19593
  }
19591
19594
  initSocket(cb) {
19592
- if (this.connected) return void cb?.();
19593
- if (this.connecting) return;
19595
+ if (this.connected) {
19596
+ this.options.logger.debug("Recorder: already **connected**. Not going to initialize a new WebSocket connection.");
19597
+ cb?.();
19598
+ return;
19599
+ }
19600
+ if (this.connecting) return void this.options.logger.debug("Recorder: already **connecting**. Not going to initialize a new WebSocket connection.");
19594
19601
  if (util_isAutomatedUserAgent()) {
19595
19602
  this.connecting = false;
19596
19603
  this.options.logger.debug("Recorder: skipping web socket connection for an automated crawler");
@@ -20086,11 +20093,7 @@
20086
20093
  this.connecting = false;
20087
20094
  if (this.userMedia) this.userMedia.unloadRemainingEventListeners();
20088
20095
  if (this.submitting) ;
20089
- else if (this.stream) {
20090
- this.options.logger.debug("Recorder: destroying stream ...");
20091
- this.stream.destroy();
20092
- this.stream = void 0;
20093
- }
20096
+ else if (this.stream) this.discardSocket();
20094
20097
  this.unloaded = true;
20095
20098
  this.built = this.connecting = this.connected = false;
20096
20099
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "15.8.2",
3
+ "version": "15.8.4",
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",