videomail-client 15.8.0 → 15.8.1

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.0"
10975
+ rE: "15.8.1"
10976
10976
  };
10977
10977
  function isAudioEnabled(options) {
10978
10978
  return Boolean(options.audio.enabled);
@@ -19681,13 +19681,16 @@ var __webpack_exports__ = {};
19681
19681
  window.clearTimeout(this.connectionTimeout);
19682
19682
  this.connectionTimeout = void 0;
19683
19683
  }
19684
+ isOnline() {
19685
+ return navigator.onLine;
19686
+ }
19684
19687
  failConnection(params) {
19685
19688
  if (this.connectionFailed || this.connected || this.unloaded) return;
19686
19689
  this.connectionFailed = true;
19687
19690
  this.connecting = false;
19688
19691
  this.clearConnectionTimeout();
19689
19692
  const { url2Connect, cause } = params;
19690
- const online = navigator.onLine;
19693
+ const online = this.isOnline();
19691
19694
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
19692
19695
  const closeEvent = this.lastCloseEvent;
19693
19696
  const socketError = this.lastSocketError;
@@ -19877,7 +19880,10 @@ var __webpack_exports__ = {};
19877
19880
  if (this.stream) {
19878
19881
  const connectionTimeoutMs = this.options.timeouts.connection;
19879
19882
  this.connectionTimeout = window.setTimeout(()=>{
19880
- this.failConnection({
19883
+ if (this.isOnline() && this.isUserMediaLoaded()) {
19884
+ this.options.logger.debug(`${PIPE_SYMBOL}Reconnecting due to connection timeout.`);
19885
+ this.initSocket();
19886
+ } else this.failConnection({
19881
19887
  url2Connect,
19882
19888
  cause: "timeout"
19883
19889
  });
@@ -20078,8 +20084,8 @@ var __webpack_exports__ = {};
20078
20084
  ideal: idealHeight
20079
20085
  };
20080
20086
  }
20081
- this.options.logger.debug(`Recorder: our webcam constraints are: ${util_pretty(constraints)}`);
20082
- this.options.logger.debug(`Recorder: available webcam constraints are: ${util_pretty(navigator.mediaDevices.getSupportedConstraints())}`);
20087
+ this.options.logger.debug(util_summarize("Recorder: our webcam constraints are:", constraints));
20088
+ this.options.logger.debug(util_summarize("Recorder: available webcam constraints are:", navigator.mediaDevices.getSupportedConstraints()));
20083
20089
  const streamPromise = navigator.mediaDevices.getUserMedia(constraints);
20084
20090
  streamPromise.then((localStream)=>{
20085
20091
  this.getUserMediaCallback(localStream, params);
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.0"
3623
+ rE: "15.8.1"
3624
3624
  };
3625
3625
  function isAudioEnabled(options) {
3626
3626
  return Boolean(options.audio.enabled);
@@ -6710,13 +6710,16 @@ class Recorder extends util_Despot {
6710
6710
  window.clearTimeout(this.connectionTimeout);
6711
6711
  this.connectionTimeout = void 0;
6712
6712
  }
6713
+ isOnline() {
6714
+ return navigator.onLine;
6715
+ }
6713
6716
  failConnection(params) {
6714
6717
  if (this.connectionFailed || this.connected || this.unloaded) return;
6715
6718
  this.connectionFailed = true;
6716
6719
  this.connecting = false;
6717
6720
  this.clearConnectionTimeout();
6718
6721
  const { url2Connect, cause } = params;
6719
- const online = navigator.onLine;
6722
+ const online = this.isOnline();
6720
6723
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
6721
6724
  const closeEvent = this.lastCloseEvent;
6722
6725
  const socketError = this.lastSocketError;
@@ -6905,7 +6908,10 @@ class Recorder extends util_Despot {
6905
6908
  if (this.stream) {
6906
6909
  const connectionTimeoutMs = this.options.timeouts.connection;
6907
6910
  this.connectionTimeout = window.setTimeout(()=>{
6908
- this.failConnection({
6911
+ if (this.isOnline() && this.isUserMediaLoaded()) {
6912
+ this.options.logger.debug(`${PIPE_SYMBOL}Reconnecting due to connection timeout.`);
6913
+ this.initSocket();
6914
+ } else this.failConnection({
6909
6915
  url2Connect,
6910
6916
  cause: "timeout"
6911
6917
  });
@@ -7103,8 +7109,8 @@ class Recorder extends util_Despot {
7103
7109
  ideal: idealHeight
7104
7110
  };
7105
7111
  }
7106
- this.options.logger.debug(`Recorder: our webcam constraints are: ${util_pretty(constraints)}`);
7107
- this.options.logger.debug(`Recorder: available webcam constraints are: ${util_pretty(navigator.mediaDevices.getSupportedConstraints())}`);
7112
+ this.options.logger.debug(util_summarize("Recorder: our webcam constraints are:", constraints));
7113
+ this.options.logger.debug(util_summarize("Recorder: available webcam constraints are:", navigator.mediaDevices.getSupportedConstraints()));
7108
7114
  const streamPromise = navigator.mediaDevices.getUserMedia(constraints);
7109
7115
  streamPromise.then((localStream)=>{
7110
7116
  this.getUserMediaCallback(localStream, params);
@@ -60,6 +60,7 @@ declare class Recorder extends Despot {
60
60
  private onUserMediaReady;
61
61
  private clearRetryTimeout;
62
62
  private clearConnectionTimeout;
63
+ private isOnline;
63
64
  private failConnection;
64
65
  private calculateFrameProgress;
65
66
  private calculateSampleProgress;
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.0"
10981
+ rE: "15.8.1"
10982
10982
  };
10983
10983
  function isAudioEnabled(options) {
10984
10984
  return Boolean(options.audio.enabled);
@@ -19459,13 +19459,16 @@
19459
19459
  window.clearTimeout(this.connectionTimeout);
19460
19460
  this.connectionTimeout = void 0;
19461
19461
  }
19462
+ isOnline() {
19463
+ return navigator.onLine;
19464
+ }
19462
19465
  failConnection(params) {
19463
19466
  if (this.connectionFailed || this.connected || this.unloaded) return;
19464
19467
  this.connectionFailed = true;
19465
19468
  this.connecting = false;
19466
19469
  this.clearConnectionTimeout();
19467
19470
  const { url2Connect, cause } = params;
19468
- const online = navigator.onLine;
19471
+ const online = this.isOnline();
19469
19472
  const elapsedMs = this.connectingStartedAt ? Date.now() - this.connectingStartedAt : void 0;
19470
19473
  const closeEvent = this.lastCloseEvent;
19471
19474
  const socketError = this.lastSocketError;
@@ -19654,7 +19657,10 @@
19654
19657
  if (this.stream) {
19655
19658
  const connectionTimeoutMs = this.options.timeouts.connection;
19656
19659
  this.connectionTimeout = window.setTimeout(()=>{
19657
- this.failConnection({
19660
+ if (this.isOnline() && this.isUserMediaLoaded()) {
19661
+ this.options.logger.debug(`${PIPE_SYMBOL}Reconnecting due to connection timeout.`);
19662
+ this.initSocket();
19663
+ } else this.failConnection({
19658
19664
  url2Connect,
19659
19665
  cause: "timeout"
19660
19666
  });
@@ -19852,8 +19858,8 @@
19852
19858
  ideal: idealHeight
19853
19859
  };
19854
19860
  }
19855
- this.options.logger.debug(`Recorder: our webcam constraints are: ${util_pretty(constraints)}`);
19856
- this.options.logger.debug(`Recorder: available webcam constraints are: ${util_pretty(navigator.mediaDevices.getSupportedConstraints())}`);
19861
+ this.options.logger.debug(util_summarize("Recorder: our webcam constraints are:", constraints));
19862
+ this.options.logger.debug(util_summarize("Recorder: available webcam constraints are:", navigator.mediaDevices.getSupportedConstraints()));
19857
19863
  const streamPromise = navigator.mediaDevices.getUserMedia(constraints);
19858
19864
  streamPromise.then((localStream)=>{
19859
19865
  this.getUserMediaCallback(localStream, params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "15.8.0",
3
+ "version": "15.8.1",
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",
@@ -88,11 +88,11 @@
88
88
  "@rsbuild/plugin-node-polyfill": "1.4.6",
89
89
  "@rsbuild/plugin-stylus": "2.0.1",
90
90
  "@rsdoctor/rspack-plugin": "1.6.4",
91
- "@rslib/core": "1.0.2",
92
- "@storybook/addon-a11y": "10.6.0",
93
- "@storybook/addon-docs": "10.6.0",
94
- "@storybook/addon-links": "10.6.0",
95
- "@storybook/html": "10.6.0",
91
+ "@rslib/core": "1.0.3",
92
+ "@storybook/addon-a11y": "10.6.1",
93
+ "@storybook/addon-docs": "10.6.1",
94
+ "@storybook/addon-links": "10.6.1",
95
+ "@storybook/html": "10.6.1",
96
96
  "@tsconfig/node26": "26.0.1",
97
97
  "@tsconfig/strictest": "2.0.8",
98
98
  "@types/defined": "1.0.2",
@@ -121,7 +121,7 @@
121
121
  "prettier-plugin-packagejson": "3.0.2",
122
122
  "prettier-plugin-sh": "0.20.2",
123
123
  "release-it": "21.1.0",
124
- "storybook": "10.6.0",
124
+ "storybook": "10.6.1",
125
125
  "storybook-html-rsbuild": "3.6.0",
126
126
  "type-fest": "5.10.0",
127
127
  "typescript": "6.0.3",