videomail-client 9.2.19 → 9.2.20

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.
@@ -22,6 +22,7 @@
22
22
  "gulpfile",
23
23
  "hyperscript",
24
24
  "keymirror",
25
+ "KHTML",
25
26
  "Mbit",
26
27
  "packagejson",
27
28
  "playsinline",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "9.2.19",
3
+ "version": "9.2.20",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -108,7 +108,7 @@
108
108
  "gulp-terser": "2.1.0",
109
109
  "minimist": "1.2.8",
110
110
  "nib": "1.2.0",
111
- "postcss": "8.4.41",
111
+ "postcss": "8.4.43",
112
112
  "prettier": "3.3.3",
113
113
  "prettier-plugin-curly": "0.2.2",
114
114
  "prettier-plugin-organize-imports": "4.0.0",
@@ -17267,7 +17267,7 @@ function wrappy (fn, cb) {
17267
17267
  },{}],116:[function(_dereq_,module,exports){
17268
17268
  module.exports={
17269
17269
  "name": "videomail-client",
17270
- "version": "9.2.19",
17270
+ "version": "9.2.20",
17271
17271
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
17272
17272
  "keywords": [
17273
17273
  "webcam",
@@ -17375,7 +17375,7 @@ module.exports={
17375
17375
  "gulp-terser": "2.1.0",
17376
17376
  "minimist": "1.2.8",
17377
17377
  "nib": "1.2.0",
17378
- "postcss": "8.4.41",
17378
+ "postcss": "8.4.43",
17379
17379
  "prettier": "3.3.3",
17380
17380
  "prettier-plugin-curly": "0.2.2",
17381
17381
  "prettier-plugin-organize-imports": "4.0.0",
@@ -18342,18 +18342,18 @@ var Browser = function Browser(options) {
18342
18342
  // good to be able to distinguish between two reasons why and what sort of camera it is
18343
18343
  if (!okBrowser) {
18344
18344
  if (isMobile) {
18345
- message = "Sorry, your browser is unable to use your mobile camera.";
18345
+ message = "Sorry, your browser is unable to use your mobile camera";
18346
18346
  } else {
18347
- message = "Sorry, your browser is unable to use webcams.";
18347
+ message = "Sorry, your browser is unable to use webcams";
18348
18348
  }
18349
18349
  } else if (isMobile) {
18350
18350
  if (isFacebook) {
18351
- message = "Sorry, the Facebook app cannot record from your mobile camera.";
18351
+ message = "Sorry, the Facebook app cannot record from your mobile camera";
18352
18352
  } else {
18353
- message = "Sorry, your browser cannot record from your mobile camera.";
18353
+ message = "Sorry, your browser cannot record from your mobile camera";
18354
18354
  }
18355
18355
  } else {
18356
- message = "Sorry, your browser cannot record from webcams.";
18356
+ message = "Sorry, your browser cannot record from webcams";
18357
18357
  }
18358
18358
  if (isBadIOS) {
18359
18359
  /*
@@ -18413,11 +18413,11 @@ var Browser = function Browser(options) {
18413
18413
  var message = "Unable to access webcam";
18414
18414
  var explanation;
18415
18415
  if (this.isChromeBased()) {
18416
- explanation = "Click on the allow button to grant access to your webcam.";
18416
+ explanation = "Click on the allow button to grant access to your webcam";
18417
18417
  } else if (this.isFirefox()) {
18418
- explanation = "Please grant Firefox access to your webcam.";
18418
+ explanation = "Please grant Firefox access to your webcam";
18419
18419
  } else {
18420
- explanation = "Your system does not let your browser access your webcam.";
18420
+ explanation = "Your system does not let your browser access your webcam";
18421
18421
  }
18422
18422
  return _videomailError.default.create(message, explanation, options);
18423
18423
  };
@@ -18445,10 +18445,10 @@ var Browser = function Browser(options) {
18445
18445
  this.getUsefulData = function () {
18446
18446
  return {
18447
18447
  browser: uaParser.browser,
18448
+ cpu: uaParser.cpu.architecture ? uaParser.cpu : undefined,
18448
18449
  device: uaParser.device.type ? uaParser.device : undefined,
18449
- os: uaParser.os,
18450
18450
  engine: uaParser.engine,
18451
- cpu: uaParser.cpu
18451
+ os: uaParser.os.name && uaParser.os.version ? uaParser.os : undefined
18452
18452
  };
18453
18453
  };
18454
18454
  };
@@ -18892,11 +18892,16 @@ var _pretty = _interopRequireDefault(_dereq_("./pretty"));
18892
18892
  var VIDEOMAIL_ERR_NAME = "Videomail Error";
18893
18893
  var VideomailError = (0, _createError.default)(Error, VIDEOMAIL_ERR_NAME, {
18894
18894
  title: undefined,
18895
+ message: undefined,
18895
18896
  explanation: undefined,
18896
18897
  logLines: undefined,
18898
+ siteName: undefined,
18897
18899
  cookie: undefined,
18898
18900
  location: undefined,
18899
18901
  err: undefined,
18902
+ promise: undefined,
18903
+ cause: undefined,
18904
+ reason: undefined,
18900
18905
  browser: undefined,
18901
18906
  cpu: undefined,
18902
18907
  device: undefined,
@@ -19189,22 +19194,24 @@ VideomailError.create = function (err, explanation, options, parameters) {
19189
19194
  var debug = options && options.debug || console.log;
19190
19195
  debug("VideomailError: create()", message, explanation || "(no explanation set)");
19191
19196
  var usefulClientData = browser.getUsefulData();
19192
- var videomailError = new VideomailError(message, {
19197
+ var cookies = global.document.cookie.split("; ");
19198
+ var errData = {
19193
19199
  title: "videomail-client error",
19200
+ message: message,
19194
19201
  explanation: explanation,
19195
19202
  logLines: logLines,
19196
- location: window.location.href,
19197
- cookie: global.document.cookie.split("; ").join(",\n"),
19198
19203
  siteName: options.siteName,
19199
- err: err instanceof Error ? err : undefined,
19200
19204
  browser: usefulClientData.browser,
19201
19205
  cpu: usefulClientData.cpu,
19202
19206
  device: usefulClientData.device,
19203
19207
  engine: usefulClientData.engine,
19204
19208
  os: usefulClientData.os,
19209
+ location: window.location.href,
19210
+ cookie: cookies.length > 0 ? cookies.join(",\n") : undefined,
19205
19211
  screen: [screen.width, screen.height, screen.colorDepth].join("×"),
19206
19212
  orientation: typeof screen.orientation === "string" ? screen.orientation : screen.orientation.type.toString()
19207
- });
19213
+ };
19214
+ var videomailError = new VideomailError(err instanceof Error ? err : message, errData);
19208
19215
  var resource;
19209
19216
  var reportErrors = false;
19210
19217
  if (options.reportErrors) {
@@ -19489,14 +19496,6 @@ var Buttons = function Buttons(container, options) {
19489
19496
  if (!options.enableAutoValidation) {
19490
19497
  enable(submitButton);
19491
19498
  }
19492
- if (!params.recordWhenReady) {
19493
- if (isShown(audioOnRadioPair)) {
19494
- enable(audioOnRadioPair);
19495
- }
19496
- if (isShown(audioOffRadioPair)) {
19497
- enable(audioOffRadioPair);
19498
- }
19499
- }
19500
19499
  }
19501
19500
  function onGoingBack() {
19502
19501
  hide(recordAgainButton);
@@ -19514,6 +19513,14 @@ var Buttons = function Buttons(container, options) {
19514
19513
  if (options.enableAutoValidation) {
19515
19514
  disable(submitButton);
19516
19515
  }
19516
+ if (!params.recordWhenReady) {
19517
+ if (isShown(audioOnRadioPair)) {
19518
+ enable(audioOnRadioPair);
19519
+ }
19520
+ if (isShown(audioOffRadioPair)) {
19521
+ enable(audioOffRadioPair);
19522
+ }
19523
+ }
19517
19524
  }
19518
19525
  function onResetting() {
19519
19526
  disable(submitButton);
@@ -19747,6 +19754,8 @@ var Buttons = function Buttons(container, options) {
19747
19754
  };
19748
19755
  this.unload = function () {
19749
19756
  if (built) {
19757
+ // Disables all buttons
19758
+ self.reset();
19750
19759
  debug("Buttons: unload()");
19751
19760
  self.removeAllListeners();
19752
19761
  built = false;
@@ -21665,7 +21674,7 @@ var RecorderInsides = function RecorderInsides(visuals, options) {
21665
21674
  stopRecording();
21666
21675
  }).on(_events.default.PAUSED, function () {
21667
21676
  pauseRecording();
21668
- }).on(_events.default.RESETTING, onResetting).on(_events.default.HIDE, function () {
21677
+ }).on(_events.default.ERROR, onResetting).on(_events.default.RESETTING, onResetting).on(_events.default.HIDE, function () {
21669
21678
  self.hideCountdown();
21670
21679
  });
21671
21680
  }
@@ -22077,7 +22086,14 @@ var Recorder = function Recorder(visuals, replay) {
22077
22086
  var onFlushedCallback = opts && opts.onFlushedCallback;
22078
22087
  try {
22079
22088
  stream.write(buffer, function () {
22080
- onFlushedCallback && onFlushedCallback(opts);
22089
+ if (!onFlushedCallback) {
22090
+ return;
22091
+ }
22092
+ try {
22093
+ onFlushedCallback(opts);
22094
+ } catch (exc) {
22095
+ self.emit(_events.default.ERROR, _videomailError.default.create("Failed to write stream buffer", "stream.write() failed because of ".concat((0, _pretty.default)(exc)), options));
22096
+ }
22081
22097
  });
22082
22098
  } catch (exc) {
22083
22099
  self.emit(_events.default.ERROR, _videomailError.default.create("Failed writing to server", "stream.write() failed because of ".concat((0, _pretty.default)(exc)), options));
@@ -22311,7 +22327,7 @@ var Recorder = function Recorder(visuals, replay) {
22311
22327
  */
22312
22328
  } else {
22313
22329
  // or else it could be a poor wifi connection...
22314
- videomailError = _videomailError.default.create("Data exchange interrupted", "Please check your network connection and reload.", options);
22330
+ videomailError = _videomailError.default.create("Data exchange interrupted", "Please check your network connection and reload", options);
22315
22331
  }
22316
22332
  self.emit(_events.default.ERROR, videomailError);
22317
22333
  });
@@ -22865,10 +22881,10 @@ var Recorder = function Recorder(visuals, replay) {
22865
22881
  self.emit(_events.default.RECORDING, framesCount);
22866
22882
 
22867
22883
  // see https://github.com/hapticdata/animitter/issues/3
22868
- loop.on("update", function (deltaTime, elapsedTime) {
22884
+ loop.on("update", function (_deltaTime, elapsedTime) {
22869
22885
  // x1000 because of milliseconds
22870
22886
  var avgFPS = framesCount / elapsedTime * 1000;
22871
- debug("Recorder: avgFps =", Math.round(avgFPS));
22887
+ debug("Recorder: avgFps = ".concat(Math.round(avgFPS), ", framesCount = ").concat(framesCount));
22872
22888
  });
22873
22889
  loop.start();
22874
22890
  };
@@ -23888,16 +23904,8 @@ Object.defineProperty(exports, "__esModule", {
23888
23904
  exports.default = void 0;
23889
23905
  var _client = _interopRequireDefault(_dereq_("./client"));
23890
23906
  var _standardize = _interopRequireDefault(_dereq_("./util/standardize"));
23891
- if (!navigator) {
23892
- throw new Error("Navigator is missing!");
23893
- } else {
23894
- // Ensures Videomail functionality is not broken on exotic browsers with shims.
23895
- (0, _standardize.default)(window, navigator);
23896
- }
23897
-
23898
- // Provide both ways
23899
-
23900
- // export { Client };
23907
+ // Ensures Videomail functionality is not broken on exotic browsers with shims.
23908
+ (0, _standardize.default)(window, navigator);
23901
23909
  var _default = exports.default = _client.default;
23902
23910
 
23903
23911
  },{"./client":117,"./util/standardize":130,"@babel/runtime/helpers/interopRequireDefault":4}]},{},["videomail-client"])("videomail-client")