videomail-client 8.3.2 → 8.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "8.3.2",
3
+ "version": "8.3.4",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "author": "Michael Heuberger <michael.heuberger@binarykitchen.com>",
6
6
  "contributors": [
@@ -115,7 +115,7 @@
115
115
  "gulp-terser": "2.1.0",
116
116
  "minimist": "1.2.8",
117
117
  "nib": "1.2.0",
118
- "postcss": "8.4.40",
118
+ "postcss": "8.4.41",
119
119
  "prettier": "3.3.3",
120
120
  "router": "1.3.8",
121
121
  "tape": "5.8.1",
@@ -17502,7 +17502,7 @@ function wrappy (fn, cb) {
17502
17502
  },{}],116:[function(_dereq_,module,exports){
17503
17503
  module.exports={
17504
17504
  "name": "videomail-client",
17505
- "version": "8.3.2",
17505
+ "version": "8.3.4",
17506
17506
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
17507
17507
  "author": "Michael Heuberger <michael.heuberger@binarykitchen.com>",
17508
17508
  "contributors": [
@@ -17617,7 +17617,7 @@ module.exports={
17617
17617
  "gulp-terser": "2.1.0",
17618
17618
  "minimist": "1.2.8",
17619
17619
  "nib": "1.2.0",
17620
- "postcss": "8.4.40",
17620
+ "postcss": "8.4.41",
17621
17621
  "prettier": "3.3.3",
17622
17622
  "router": "1.3.8",
17623
17623
  "tape": "5.8.1",
@@ -18523,9 +18523,7 @@ var Browser = function Browser(options) {
18523
18523
  this.checkRecordingCapabilities = function () {
18524
18524
  var err;
18525
18525
  if (!isHTTPS) {
18526
- err = _videomailError.default.create({
18527
- message: "Sorry, your page is insecure"
18528
- }, "Please switch to HTTPS to ensure all is encrypted.", options, {
18526
+ err = _videomailError.default.create("Sorry, your page is insecure", "Please switch to HTTPS to ensure all is encrypted.", options, {
18529
18527
  classList: [_videomailError.default.BROWSER_PROBLEM]
18530
18528
  });
18531
18529
  } else if (!okBrowser || !this.canRecord()) {
@@ -18540,18 +18538,18 @@ var Browser = function Browser(options) {
18540
18538
  // good to be able to distinguish between two reasons why and what sort of camera it is
18541
18539
  if (!okBrowser) {
18542
18540
  if (isMobile) {
18543
- message = "Sorry, your browser is unable to use your mobile camera";
18541
+ message = "Sorry, your browser is unable to use your mobile camera.";
18544
18542
  } else {
18545
- message = "Sorry, your browser is unable to use webcams";
18543
+ message = "Sorry, your browser is unable to use webcams.";
18546
18544
  }
18547
18545
  } else if (isMobile) {
18548
18546
  if (isFacebook) {
18549
- message = "Sorry, the Facebook app cannot record from your mobile camera";
18547
+ message = "Sorry, the Facebook app cannot record from your mobile camera.";
18550
18548
  } else {
18551
- message = "Sorry, your browser cannot record from your mobile camera";
18549
+ message = "Sorry, your browser cannot record from your mobile camera.";
18552
18550
  }
18553
18551
  } else {
18554
- message = "Sorry, your browser cannot record from webcams";
18552
+ message = "Sorry, your browser cannot record from webcams.";
18555
18553
  }
18556
18554
  if (isBadIOS) {
18557
18555
  /*
@@ -18560,9 +18558,7 @@ var Browser = function Browser(options) {
18560
18558
  */
18561
18559
  options.reportErrors = false;
18562
18560
  }
18563
- err = _videomailError.default.create({
18564
- message: message
18565
- }, getUserMediaWarning(), options, {
18561
+ err = _videomailError.default.create(message, getUserMediaWarning(), options, {
18566
18562
  classList: classList
18567
18563
  });
18568
18564
  }
@@ -18648,7 +18644,7 @@ var Browser = function Browser(options) {
18648
18644
  device: uaParser.device,
18649
18645
  os: uaParser.os,
18650
18646
  engine: uaParser.engine,
18651
- userAgent: ua
18647
+ cpu: uaParser.cpu
18652
18648
  };
18653
18649
  };
18654
18650
  };
@@ -19073,6 +19069,7 @@ function _default() {
19073
19069
  }
19074
19070
 
19075
19071
  },{"@babel/runtime/helpers/interopRequireDefault":3,"classlist.js":20,"request-frame":97}],130:[function(_dereq_,module,exports){
19072
+ (function (global){(function (){
19076
19073
  "use strict";
19077
19074
 
19078
19075
  var _interopRequireDefault = _dereq_("@babel/runtime/helpers/interopRequireDefault");
@@ -19089,11 +19086,19 @@ var _safeJsonStringify = _interopRequireDefault(_dereq_("safe-json-stringify"));
19089
19086
 
19090
19087
  var VIDEOMAIL_ERR_NAME = "Videomail Error";
19091
19088
  var VideomailError = (0, _createError.default)(Error, VIDEOMAIL_ERR_NAME, {
19089
+ title: undefined,
19092
19090
  explanation: undefined,
19093
19091
  logLines: undefined,
19094
- useragent: undefined,
19095
- url: undefined,
19096
- stack: undefined
19092
+ cookie: undefined,
19093
+ location: undefined,
19094
+ err: undefined,
19095
+ browser: undefined,
19096
+ cpu: undefined,
19097
+ device: undefined,
19098
+ engine: undefined,
19099
+ os: undefined,
19100
+ screen: undefined,
19101
+ orientation: undefined
19097
19102
  });
19098
19103
 
19099
19104
  // shim pretty to exclude stack always
@@ -19131,11 +19136,7 @@ VideomailError.create = function (err, explanation, options, parameters) {
19131
19136
  }
19132
19137
  options || (options = {});
19133
19138
  parameters || (parameters = {});
19134
-
19135
- // be super robust
19136
- var debug = options && options.debug || console.log;
19137
19139
  var audioEnabled = options && options.isAudioEnabled && options.isAudioEnabled();
19138
- debug("VideomailError: create()", err, explanation || "(no explanation set)");
19139
19140
  var classList = parameters.classList || [];
19140
19141
 
19141
19142
  /*
@@ -19146,7 +19147,6 @@ VideomailError.create = function (err, explanation, options, parameters) {
19146
19147
  var browser = new Browser(options);
19147
19148
  var errType;
19148
19149
  var message;
19149
- var stack;
19150
19150
 
19151
19151
  // whole code is ugly because all browsers behave so differently :(
19152
19152
 
@@ -19170,8 +19170,8 @@ VideomailError.create = function (err, explanation, options, parameters) {
19170
19170
  }
19171
19171
  } else if (err.constructor && err.constructor.name === VideomailError.OVERCONSTRAINED) {
19172
19172
  errType = VideomailError.OVERCONSTRAINED;
19173
- } else if (err.message === VideomailError.STARTING_FAILED) {
19174
- errType = err.message;
19173
+ } else if (err.explanation === VideomailError.STARTING_FAILED) {
19174
+ errType = err.explanation;
19175
19175
  } else if (err.name) {
19176
19176
  errType = err.name;
19177
19177
  } else if (err.type === "error" && err.target.bufferedAmount === 0) {
@@ -19182,11 +19182,6 @@ VideomailError.create = function (err, explanation, options, parameters) {
19182
19182
  } else {
19183
19183
  errType = err;
19184
19184
  }
19185
- if (err && err.stack) {
19186
- stack = err.stack;
19187
- } else {
19188
- stack = new Error().stack;
19189
- }
19190
19185
  switch (errType) {
19191
19186
  case VideomailError.SECURITY_ERROR:
19192
19187
  message = "The operation was insecure";
@@ -19212,8 +19207,8 @@ VideomailError.create = function (err, explanation, options, parameters) {
19212
19207
  case "SourceUnavailableError":
19213
19208
  message = "Source of your webcam cannot be accessed";
19214
19209
  explanation = "Probably it is locked from another process or has a hardware error.";
19215
- if (err.message) {
19216
- err.message += " Details: ".concat(err.message);
19210
+ if (err.explanation) {
19211
+ err.explanation += " Details: ".concat(err.explanation);
19217
19212
  }
19218
19213
  break;
19219
19214
  case VideomailError.NOT_FOUND_ERROR:
@@ -19258,7 +19253,7 @@ VideomailError.create = function (err, explanation, options, parameters) {
19258
19253
  break;
19259
19254
  case VideomailError.STARTING_FAILED:
19260
19255
  message = "Starting video failed";
19261
- explanation = "Most likely this happens when the webam is already active in another browser.";
19256
+ explanation = "Most likely this happens when the webcam is already active in another browser.";
19262
19257
  classList.push(VideomailError.WEBCAM_PROBLEM);
19263
19258
  break;
19264
19259
  case "DevicesNotFoundError":
@@ -19329,8 +19324,8 @@ VideomailError.create = function (err, explanation, options, parameters) {
19329
19324
  * error objects can be prettified to undefined sometimes
19330
19325
  */
19331
19326
  if (!explanation && originalExplanation) {
19332
- if (originalExplanation.message) {
19333
- explanation = originalExplanation.message;
19327
+ if (originalExplanation.explanation) {
19328
+ explanation = originalExplanation.explanation;
19334
19329
  } else {
19335
19330
  // tried toString before but nah
19336
19331
  explanation = "Inspected: ".concat((0, _safeJsonStringify.default)(originalExplanation));
@@ -19354,7 +19349,7 @@ VideomailError.create = function (err, explanation, options, parameters) {
19354
19349
  var details = pretty(err.details);
19355
19350
  if (!explanation) {
19356
19351
  explanation = details;
19357
- } else {
19352
+ } else if (details) {
19358
19353
  explanation += ";<br/>".concat(details);
19359
19354
  }
19360
19355
  }
@@ -19384,25 +19379,26 @@ VideomailError.create = function (err, explanation, options, parameters) {
19384
19379
  if (options.logger && options.logger.getLines) {
19385
19380
  logLines = options.logger.getLines();
19386
19381
  }
19387
- if (stack) {
19388
- message = new Error(message);
19389
- message.stack = stack;
19390
- }
19391
- var errCode = "none";
19392
- if (err) {
19393
- errCode = "code=".concat(err.code ? err.code : "undefined");
19394
- errCode += ", type=".concat(err.type ? err.type : "undefined");
19395
- errCode += ", name=".concat(err.name ? err.name : "undefined");
19396
- errCode += ", message=".concat(err.message ? err.message : "undefined");
19397
- }
19382
+
19383
+ // be super robust
19384
+ var debug = options && options.debug || console.log;
19385
+ debug("VideomailError: create()", message, explanation || "(no explanation set)");
19386
+ var usefulClientData = browser.getUsefulData();
19398
19387
  var videomailError = new VideomailError(message, {
19388
+ title: "videomail-client error",
19399
19389
  explanation: explanation,
19400
19390
  logLines: logLines,
19401
- client: browser.getUsefulData(),
19402
- url: window.location.href,
19391
+ location: window.location.href,
19392
+ cookie: global.document.cookie.split("; ").join(",\n"),
19403
19393
  siteName: options.siteName,
19404
- code: errCode,
19405
- stack: stack // have to assign it manually again because it is kinda protected
19394
+ err: err instanceof Error ? err : undefined,
19395
+ browser: usefulClientData.browser,
19396
+ cpu: usefulClientData.cpu,
19397
+ device: usefulClientData.device,
19398
+ engine: usefulClientData.engine,
19399
+ os: usefulClientData.os,
19400
+ screen: [screen.width, screen.height, screen.colorDepth].join("×"),
19401
+ orientation: typeof screen.orientation === "string" ? screen.orientation : screen.orientation.type.toString()
19406
19402
  });
19407
19403
  var resource;
19408
19404
  var reportErrors = false;
@@ -19449,6 +19445,7 @@ VideomailError.create = function (err, explanation, options, parameters) {
19449
19445
  };
19450
19446
  var _default = exports.default = VideomailError;
19451
19447
 
19448
+ }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
19452
19449
  },{"./../resource":121,"./browser":123,"./pretty":128,"@babel/runtime/helpers/interopRequireDefault":3,"@babel/runtime/helpers/typeof":7,"create-error":24,"safe-json-stringify":99}],131:[function(_dereq_,module,exports){
19453
19450
  "use strict";
19454
19451
 
@@ -20342,7 +20339,9 @@ var Container = function Container(options) {
20342
20339
  if (self.isReplayShown()) {
20343
20340
  self.emit(_events.default.PREVIEW);
20344
20341
  } else {
20345
- self.emit(_events.default.FORM_READY, "paused", paused);
20342
+ self.emit(_events.default.FORM_READY, {
20343
+ paused: paused
20344
+ });
20346
20345
  }
20347
20346
  }
20348
20347
  }
@@ -21104,7 +21103,7 @@ var Visuals = function Visuals(container, options) {
21104
21103
  if (!blockingOptions.hideForm && !options.adjustFormOnBrowserError) {
21105
21104
  /*
21106
21105
  * do nothing, user still can enter form inputs
21107
- * can be useful when you are on i.E. seeflow's contact page and
21106
+ * can be useful when you are on i.E. Seeflow's contact page and
21108
21107
  * still want to tick off the webcam option
21109
21108
  */
21110
21109
  } else {
@@ -21960,7 +21959,7 @@ var Notifier = function Notifier(visuals, options) {
21960
21959
  var message = err.message ? err.message.toString() : err.toString();
21961
21960
  var explanation = err.explanation ? err.explanation.toString() : null;
21962
21961
  if (!message) {
21963
- options.debug("Weird empty message generated for error", err);
21962
+ options.debug("Weird empty error message generated for error", err);
21964
21963
  }
21965
21964
  self.notify(message, explanation, {
21966
21965
  blocking: true,
@@ -22213,7 +22212,7 @@ var Recorder = function Recorder(visuals, replay) {
22213
22212
  function onUserMediaReady() {
22214
22213
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
22215
22214
  try {
22216
- debug("Recorder: onUserMediaReady()", params);
22215
+ debug("Recorder: onUserMediaReady()", (0, _safeJsonStringify.default)(params));
22217
22216
  var switchingFacingMode = params.switchingFacingMode;
22218
22217
  userMediaLoading = blocking = unloaded = submitting = false;
22219
22218
  userMediaLoaded = true;
@@ -22494,7 +22493,7 @@ var Recorder = function Recorder(visuals, replay) {
22494
22493
  }
22495
22494
  }
22496
22495
  function getUserMediaCallback(localStream, params) {
22497
- debug("Recorder: getUserMediaCallback()", params);
22496
+ debug("Recorder: getUserMediaCallback()", (0, _safeJsonStringify.default)(params));
22498
22497
  if (showUserMedia()) {
22499
22498
  try {
22500
22499
  clearUserMediaTimeout();
@@ -22554,9 +22553,9 @@ var Recorder = function Recorder(visuals, replay) {
22554
22553
  };
22555
22554
  }
22556
22555
  }
22557
- debug("Recorder: navigator.mediaDevices.getUserMedia()", "constraints", constraints);
22556
+ debug("Recorder: navigator.mediaDevices.getUserMedia()", (0, _safeJsonStringify.default)(constraints));
22558
22557
  if (navigator.mediaDevices.getSupportedConstraints) {
22559
- debug("Recorder: navigator.mediaDevices.getSupportedConstraints()", navigator.mediaDevices.getSupportedConstraints());
22558
+ debug("Recorder: navigator.mediaDevices.getSupportedConstraints()", (0, _safeJsonStringify.default)(navigator.mediaDevices.getSupportedConstraints()));
22560
22559
  }
22561
22560
  var genuineUserMediaRequest = navigator.mediaDevices.getUserMedia(constraints);
22562
22561
  if (genuineUserMediaRequest) {
@@ -22631,7 +22630,7 @@ var Recorder = function Recorder(visuals, replay) {
22631
22630
  preview(command.args);
22632
22631
  break;
22633
22632
  case "error":
22634
- this.emit(_events.default.ERROR, _videomailError.default.create("Oh no, server error!", command.args.err.toString() || "(No explanation given)", options));
22633
+ this.emit(_events.default.ERROR, _videomailError.default.create("Oh no, server error!", command.args.err.toString() || "(No message given)", options));
22635
22634
  break;
22636
22635
  case "confirmFrame":
22637
22636
  updateFrameProgress(command.args);
@@ -23455,7 +23454,9 @@ var Replay = function Replay(parentElement, options) {
23455
23454
  */
23456
23455
  setTimeout(function () {
23457
23456
  try {
23458
- replayElement && replayElement.pause();
23457
+ if (replayElement) {
23458
+ replayElement.pause();
23459
+ }
23459
23460
  } catch (exc) {
23460
23461
  // just ignore, see https://github.com/binarykitchen/videomail.io/issues/386
23461
23462
  options.logger.warn(exc);
@@ -23523,6 +23524,7 @@ var _eventEmitter = _interopRequireDefault(_dereq_("./../../util/eventEmitter"))
23523
23524
  var _events = _interopRequireDefault(_dereq_("./../../events"));
23524
23525
  var _mediaEvents = _interopRequireDefault(_dereq_("./../../util/mediaEvents"));
23525
23526
  var _videomailError = _interopRequireDefault(_dereq_("./../../util/videomailError"));
23527
+ var _safeJsonStringify = _interopRequireDefault(_dereq_("safe-json-stringify"));
23526
23528
  var _hyperscript = _interopRequireDefault(_dereq_("hyperscript"));
23527
23529
  var _pretty = _interopRequireDefault(_dereq_("./../../util/pretty"));
23528
23530
  var EVENT_ASCII = "|—O—|";
@@ -23598,7 +23600,7 @@ function _default(recorder, options) {
23598
23600
  return videoTrack;
23599
23601
  }
23600
23602
  function logEvent(event, params) {
23601
- options.debug("UserMedia: ...", EVENT_ASCII, "event", event, params);
23603
+ options.debug("UserMedia: ...", EVENT_ASCII, "event", event, (0, _safeJsonStringify.default)(params));
23602
23604
  }
23603
23605
  function isPromise(anything) {
23604
23606
  return anything && typeof Promise !== "undefined" && anything instanceof Promise;
@@ -23923,7 +23925,7 @@ function _default(recorder, options) {
23923
23925
  };
23924
23926
  }
23925
23927
 
23926
- },{"./../../events":119,"./../../util/audioRecorder":122,"./../../util/browser":123,"./../../util/eventEmitter":125,"./../../util/mediaEvents":127,"./../../util/pretty":128,"./../../util/videomailError":130,"@babel/runtime/helpers/interopRequireDefault":3,"hyperscript":61}],147:[function(_dereq_,module,exports){
23928
+ },{"./../../events":119,"./../../util/audioRecorder":122,"./../../util/browser":123,"./../../util/eventEmitter":125,"./../../util/mediaEvents":127,"./../../util/pretty":128,"./../../util/videomailError":130,"@babel/runtime/helpers/interopRequireDefault":3,"hyperscript":61,"safe-json-stringify":99}],147:[function(_dereq_,module,exports){
23927
23929
  "use strict";
23928
23930
 
23929
23931
  module.exports = '@-webkit-keyframes blink{0%{opacity:.9}35%{opacity:.9}50%{opacity:.1}85%{opacity:.1}to{opacity:.9}}@keyframes blink{0%{opacity:.9}35%{opacity:.9}50%{opacity:.1}85%{opacity:.1}to{opacity:.9}}.IIV::-webkit-media-controls-play-button,.IIV::-webkit-media-controls-start-playback-button{opacity:0;pointer-events:none;width:5px}.videomail .visuals{position:relative}.videomail .visuals video.replay{height:100%;width:100%}.videomail .countdown,.videomail .pausedHeader,.videomail .pausedHint,.videomail .recordNote,.videomail .recordTimer{height:auto;margin:0}.videomail .countdown,.videomail .facingMode,.videomail .paused,.videomail .recordNote,.videomail .recordTimer,.videomail noscript{position:absolute;z-index:100}.videomail .countdown,.videomail .pausedHeader,.videomail .pausedHint,.videomail .recordNote,.videomail .recordTimer,.videomail noscript{font-weight:700}.videomail .countdown,.videomail .paused,.videomail noscript{top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:100%}.videomail .countdown,.videomail .pausedHeader,.videomail .pausedHint{letter-spacing:4px;text-align:center;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.videomail .countdown,.videomail .pausedHeader{font-size:460%;opacity:.9}.videomail .pausedHint{font-size:150%}.videomail .facingMode{background:rgba(30,30,30,.5);border:none;bottom:.6em;color:hsla(0,0%,96%,.9);font-family:monospace;font-size:1.2em;outline:none;padding:.1em .3em;right:.7em;-webkit-transition:all .2s ease;transition:all .2s ease;z-index:10}.videomail .facingMode:hover{background:rgba(50,50,50,.7);cursor:pointer}.videomail .recordNote,.videomail .recordTimer{background:hsla(0,0%,4%,.8);color:#00d814;font-family:monospace;opacity:.9;padding:.3em .4em;right:.7em;-webkit-transition:all 1s ease;transition:all 1s ease}.videomail .recordNote.near,.videomail .recordTimer.near{color:#eb9369}.videomail .recordNote.nigh,.videomail .recordTimer.nigh{color:#ea4b2a}.videomail .recordTimer{top:.7em}.videomail .recordNote{top:3.6em}.videomail .recordNote:before{-webkit-animation:blink 1s infinite;animation:blink 1s infinite;content:"REC"}.videomail .notifier{-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;overflow:hidden}.videomail .radioGroup{display:block}.videomail video{margin-bottom:0}.videomail video.userMedia{background-color:rgba(50,50,50,.1)}';