videomail-client 5.2.1 → 5.3.0

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/README.md CHANGED
@@ -39,7 +39,7 @@ To run the prototype full of examples in your browser with Gulp, just do:
39
39
  2. `npm run watch` to ignite a static server and
40
40
  3. open `https://localhost:8443` in your browser
41
41
 
42
- Best is to study `/prototype/contact_form_json.html` which demonstrates how easy it is to integrate the videomail client into your own contact form.
42
+ Best is to study `/prototype/contact_form.html` which demonstrates how easy it is to integrate the videomail client into your own contact form.
43
43
 
44
44
  Beware that all _must run over HTTPs_. Google Chrome and soon other browsers won't allow the use of `getUserMedia()` on insecure origins.
45
45
 
package/TODO.md CHANGED
@@ -5,12 +5,13 @@
5
5
  | src/js/util/eventEmitter.js | 6 | MAKE EVENT EMITTING IN DESPOT NOT GLOBAL BUT BY CONTAINER ID INSTEAD
6
6
  | src/js/util/eventEmitter.js | 43 | have this emitted through a configuration because it is pretty noisy
7
7
  | src/js/util/humanize.js | 4 | get rid of this class and use those imports directly
8
- | src/js/wrappers/container.js | 334 | figure out how to fire dom's onload event again
9
- | src/js/wrappers/container.js | 335 | or how to run all the scripts over again
8
+ | src/js/wrappers/container.js | 293 | figure out how to fire dom's onload event again
9
+ | src/js/wrappers/container.js | 294 | or how to run all the scripts over again
10
+ | src/js/wrappers/container.js | 576 | CONTINUE FROM HERE, MAKE VALIDATION CLEVER WHEN AUTOMATIC SO THAT IT REQUIRES AT
10
11
  | src/js/wrappers/optionsWrapper.js | 27 | fix this, it's not really an option
11
12
  | src/js/wrappers/visuals/recorder.js | 582 | in https://github.com/binarykitchen/videomail-client/issues/142
12
13
  | src/js/wrappers/visuals/recorder.js | 619 | retry with navigator.getUserMedia_() maybe?
13
- | src/js/wrappers/visuals/recorder.js | 759 | commented out because for some reasons server does not accept such a long
14
+ | src/js/wrappers/visuals/recorder.js | 759 | commented out because for some reasons server does
14
15
  | src/js/wrappers/visuals/recorder.js | 764 | consider removing this later or have it for debug=1 only?
15
16
  | src/js/wrappers/visuals/userMedia.js | 309 | consider removing that if it's not the case anymore (for better performance)
16
17
  | gulpfile.js | 1 | write this in ES6 once i have figured out how to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "5.2.1",
3
+ "version": "5.3.0",
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": [
@@ -65,7 +65,7 @@
65
65
  "canvas-to-buffer": "2.0.0",
66
66
  "classlist.js": "1.1.20150312",
67
67
  "contains": "0.1.1",
68
- "core-js": "3.26.0",
68
+ "core-js": "3.26.1",
69
69
  "create-error": "0.3.1",
70
70
  "deepmerge": "4.2.2",
71
71
  "defined": "1.0.1",
@@ -102,7 +102,7 @@
102
102
  "connect-send-json": "1.0.0",
103
103
  "cssnano": "5.1.14",
104
104
  "del": "6.1.1",
105
- "eslint": "8.27.0",
105
+ "eslint": "8.28.0",
106
106
  "eslint-config-prettier": "8.5.0",
107
107
  "eslint-plugin-import": "2.26.0",
108
108
  "eslint-plugin-node": "11.1.0",
@@ -454,9 +454,9 @@
454
454
  >
455
455
  </li>
456
456
  <li>
457
- <a href="/with_time_control.html" class="" title="with_time_control.html"
458
- ><span class="name">with_time_control.html</span><span class="size">904</span
459
- ><span class="date">2022-9-22 11:11:53</span></a
457
+ <a href="/with_cc_and_bcc.html" class="" title="with_cc_and_bcc.html"
458
+ ><span class="name">with_cc_and_bcc.html</span><span class="size">1104</span
459
+ ><span class="date">2022-11-15 11:11:53</span></a
460
460
  >
461
461
  </li>
462
462
  <li>
@@ -4344,16 +4344,16 @@ module.exports = function (exec, SKIP_CLOSING) {
4344
4344
  };
4345
4345
 
4346
4346
  },{"../internals/well-known-symbol":197}],47:[function(_dereq_,module,exports){
4347
- var uncurryThisRaw = _dereq_('../internals/function-uncurry-this-raw');
4347
+ var uncurryThis = _dereq_('../internals/function-uncurry-this');
4348
4348
 
4349
- var toString = uncurryThisRaw({}.toString);
4350
- var stringSlice = uncurryThisRaw(''.slice);
4349
+ var toString = uncurryThis({}.toString);
4350
+ var stringSlice = uncurryThis(''.slice);
4351
4351
 
4352
4352
  module.exports = function (it) {
4353
4353
  return stringSlice(toString(it), 8, -1);
4354
4354
  };
4355
4355
 
4356
- },{"../internals/function-uncurry-this-raw":86}],48:[function(_dereq_,module,exports){
4356
+ },{"../internals/function-uncurry-this":87}],48:[function(_dereq_,module,exports){
4357
4357
  var TO_STRING_TAG_SUPPORT = _dereq_('../internals/to-string-tag-support');
4358
4358
  var isCallable = _dereq_('../internals/is-callable');
4359
4359
  var classofRaw = _dereq_('../internals/classof-raw');
@@ -4779,7 +4779,7 @@ module.exports = function (exec) {
4779
4779
  'use strict';
4780
4780
  // TODO: Remove from `core-js@4` since it's moved to entry points
4781
4781
  _dereq_('../modules/es.regexp.exec');
4782
- var uncurryThis = _dereq_('../internals/function-uncurry-this');
4782
+ var uncurryThis = _dereq_('../internals/function-uncurry-this-clause');
4783
4783
  var defineBuiltIn = _dereq_('../internals/define-built-in');
4784
4784
  var regexpExec = _dereq_('../internals/regexp-exec');
4785
4785
  var fails = _dereq_('../internals/fails');
@@ -4851,7 +4851,7 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
4851
4851
  if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
4852
4852
  };
4853
4853
 
4854
- },{"../internals/create-non-enumerable-property":52,"../internals/define-built-in":56,"../internals/fails":79,"../internals/function-uncurry-this":87,"../internals/regexp-exec":152,"../internals/well-known-symbol":197,"../modules/es.regexp.exec":221}],81:[function(_dereq_,module,exports){
4854
+ },{"../internals/create-non-enumerable-property":52,"../internals/define-built-in":56,"../internals/fails":79,"../internals/function-uncurry-this-clause":86,"../internals/regexp-exec":152,"../internals/well-known-symbol":197,"../modules/es.regexp.exec":221}],81:[function(_dereq_,module,exports){
4855
4855
  var NATIVE_BIND = _dereq_('../internals/function-bind-native');
4856
4856
 
4857
4857
  var FunctionPrototype = Function.prototype;
@@ -4864,7 +4864,7 @@ module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? c
4864
4864
  });
4865
4865
 
4866
4866
  },{"../internals/function-bind-native":83}],82:[function(_dereq_,module,exports){
4867
- var uncurryThis = _dereq_('../internals/function-uncurry-this');
4867
+ var uncurryThis = _dereq_('../internals/function-uncurry-this-clause');
4868
4868
  var aCallable = _dereq_('../internals/a-callable');
4869
4869
  var NATIVE_BIND = _dereq_('../internals/function-bind-native');
4870
4870
 
@@ -4878,7 +4878,7 @@ module.exports = function (fn, that) {
4878
4878
  };
4879
4879
  };
4880
4880
 
4881
- },{"../internals/a-callable":19,"../internals/function-bind-native":83,"../internals/function-uncurry-this":87}],83:[function(_dereq_,module,exports){
4881
+ },{"../internals/a-callable":19,"../internals/function-bind-native":83,"../internals/function-uncurry-this-clause":86}],83:[function(_dereq_,module,exports){
4882
4882
  var fails = _dereq_('../internals/fails');
4883
4883
 
4884
4884
  module.exports = !fails(function () {
@@ -4917,6 +4917,17 @@ module.exports = {
4917
4917
  };
4918
4918
 
4919
4919
  },{"../internals/descriptors":60,"../internals/has-own-property":94}],86:[function(_dereq_,module,exports){
4920
+ var classofRaw = _dereq_('../internals/classof-raw');
4921
+ var uncurryThis = _dereq_('../internals/function-uncurry-this');
4922
+
4923
+ module.exports = function (fn) {
4924
+ // Nashorn bug:
4925
+ // https://github.com/zloirock/core-js/issues/1128
4926
+ // https://github.com/zloirock/core-js/issues/1130
4927
+ if (classofRaw(fn) === 'Function') return uncurryThis(fn);
4928
+ };
4929
+
4930
+ },{"../internals/classof-raw":47,"../internals/function-uncurry-this":87}],87:[function(_dereq_,module,exports){
4920
4931
  var NATIVE_BIND = _dereq_('../internals/function-bind-native');
4921
4932
 
4922
4933
  var FunctionPrototype = Function.prototype;
@@ -4929,18 +4940,7 @@ module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
4929
4940
  };
4930
4941
  };
4931
4942
 
4932
- },{"../internals/function-bind-native":83}],87:[function(_dereq_,module,exports){
4933
- var classofRaw = _dereq_('../internals/classof-raw');
4934
- var uncurryThisRaw = _dereq_('../internals/function-uncurry-this-raw');
4935
-
4936
- module.exports = function (fn) {
4937
- // Nashorn bug:
4938
- // https://github.com/zloirock/core-js/issues/1128
4939
- // https://github.com/zloirock/core-js/issues/1130
4940
- if (classofRaw(fn) === 'Function') return uncurryThisRaw(fn);
4941
- };
4942
-
4943
- },{"../internals/classof-raw":47,"../internals/function-uncurry-this-raw":86}],88:[function(_dereq_,module,exports){
4943
+ },{"../internals/function-bind-native":83}],88:[function(_dereq_,module,exports){
4944
4944
  var global = _dereq_('../internals/global');
4945
4945
  var isCallable = _dereq_('../internals/is-callable');
4946
4946
 
@@ -6842,10 +6842,10 @@ var store = _dereq_('../internals/shared-store');
6842
6842
  (module.exports = function (key, value) {
6843
6843
  return store[key] || (store[key] = value !== undefined ? value : {});
6844
6844
  })('versions', []).push({
6845
- version: '3.26.0',
6845
+ version: '3.26.1',
6846
6846
  mode: IS_PURE ? 'pure' : 'global',
6847
6847
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
6848
- license: 'https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE',
6848
+ license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
6849
6849
  source: 'https://github.com/zloirock/core-js'
6850
6850
  });
6851
6851
 
@@ -7925,7 +7925,7 @@ setSpecies(ARRAY_BUFFER);
7925
7925
  },{"../internals/array-buffer":28,"../internals/export":78,"../internals/global":93,"../internals/set-species":159}],200:[function(_dereq_,module,exports){
7926
7926
  'use strict';
7927
7927
  var $ = _dereq_('../internals/export');
7928
- var uncurryThis = _dereq_('../internals/function-uncurry-this');
7928
+ var uncurryThis = _dereq_('../internals/function-uncurry-this-clause');
7929
7929
  var fails = _dereq_('../internals/fails');
7930
7930
  var ArrayBufferModule = _dereq_('../internals/array-buffer');
7931
7931
  var anObject = _dereq_('../internals/an-object');
@@ -7964,7 +7964,7 @@ $({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE },
7964
7964
  }
7965
7965
  });
7966
7966
 
7967
- },{"../internals/an-object":25,"../internals/array-buffer":28,"../internals/export":78,"../internals/fails":79,"../internals/function-uncurry-this":87,"../internals/species-constructor":164,"../internals/to-absolute-index":172,"../internals/to-length":177}],201:[function(_dereq_,module,exports){
7967
+ },{"../internals/an-object":25,"../internals/array-buffer":28,"../internals/export":78,"../internals/fails":79,"../internals/function-uncurry-this-clause":86,"../internals/species-constructor":164,"../internals/to-absolute-index":172,"../internals/to-length":177}],201:[function(_dereq_,module,exports){
7968
7968
  'use strict';
7969
7969
  var $ = _dereq_('../internals/export');
7970
7970
  var fails = _dereq_('../internals/fails');
@@ -8042,7 +8042,7 @@ $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
8042
8042
  'use strict';
8043
8043
  /* eslint-disable es/no-array-prototype-indexof -- required for testing */
8044
8044
  var $ = _dereq_('../internals/export');
8045
- var uncurryThis = _dereq_('../internals/function-uncurry-this');
8045
+ var uncurryThis = _dereq_('../internals/function-uncurry-this-clause');
8046
8046
  var $indexOf = _dereq_('../internals/array-includes').indexOf;
8047
8047
  var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict');
8048
8048
 
@@ -8063,7 +8063,7 @@ $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
8063
8063
  }
8064
8064
  });
8065
8065
 
8066
- },{"../internals/array-includes":34,"../internals/array-method-is-strict":38,"../internals/export":78,"../internals/function-uncurry-this":87}],204:[function(_dereq_,module,exports){
8066
+ },{"../internals/array-includes":34,"../internals/array-method-is-strict":38,"../internals/export":78,"../internals/function-uncurry-this-clause":86}],204:[function(_dereq_,module,exports){
8067
8067
  'use strict';
8068
8068
  var toIndexedObject = _dereq_('../internals/to-indexed-object');
8069
8069
  var addToUnscopables = _dereq_('../internals/add-to-unscopables');
@@ -9435,7 +9435,7 @@ exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {
9435
9435
  },{"../internals/array-buffer-view-core":27,"../internals/array-iteration":35}],244:[function(_dereq_,module,exports){
9436
9436
  'use strict';
9437
9437
  var global = _dereq_('../internals/global');
9438
- var uncurryThis = _dereq_('../internals/function-uncurry-this');
9438
+ var uncurryThis = _dereq_('../internals/function-uncurry-this-clause');
9439
9439
  var fails = _dereq_('../internals/fails');
9440
9440
  var aCallable = _dereq_('../internals/a-callable');
9441
9441
  var internalSort = _dereq_('../internals/array-sort');
@@ -9504,7 +9504,7 @@ exportTypedArrayMethod('sort', function sort(comparefn) {
9504
9504
  return internalSort(aTypedArray(this), getSortCompare(comparefn));
9505
9505
  }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
9506
9506
 
9507
- },{"../internals/a-callable":19,"../internals/array-buffer-view-core":27,"../internals/array-sort":42,"../internals/engine-ff-version":66,"../internals/engine-is-ie-or-edge":69,"../internals/engine-v8-version":75,"../internals/engine-webkit-version":76,"../internals/fails":79,"../internals/function-uncurry-this":87,"../internals/global":93}],245:[function(_dereq_,module,exports){
9507
+ },{"../internals/a-callable":19,"../internals/array-buffer-view-core":27,"../internals/array-sort":42,"../internals/engine-ff-version":66,"../internals/engine-is-ie-or-edge":69,"../internals/engine-v8-version":75,"../internals/engine-webkit-version":76,"../internals/fails":79,"../internals/function-uncurry-this-clause":86,"../internals/global":93}],245:[function(_dereq_,module,exports){
9508
9508
  'use strict';
9509
9509
  var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core');
9510
9510
  var toLength = _dereq_('../internals/to-length');
@@ -26004,7 +26004,7 @@ function wrappy (fn, cb) {
26004
26004
  },{}],345:[function(_dereq_,module,exports){
26005
26005
  module.exports={
26006
26006
  "name": "videomail-client",
26007
- "version": "5.2.1",
26007
+ "version": "5.3.0",
26008
26008
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
26009
26009
  "author": "Michael Heuberger <michael.heuberger@binarykitchen.com>",
26010
26010
  "contributors": [
@@ -26069,7 +26069,7 @@ module.exports={
26069
26069
  "canvas-to-buffer": "2.0.0",
26070
26070
  "classlist.js": "1.1.20150312",
26071
26071
  "contains": "0.1.1",
26072
- "core-js": "3.26.0",
26072
+ "core-js": "3.26.1",
26073
26073
  "create-error": "0.3.1",
26074
26074
  "deepmerge": "4.2.2",
26075
26075
  "defined": "1.0.1",
@@ -26106,7 +26106,7 @@ module.exports={
26106
26106
  "connect-send-json": "1.0.0",
26107
26107
  "cssnano": "5.1.14",
26108
26108
  "del": "6.1.1",
26109
- "eslint": "8.27.0",
26109
+ "eslint": "8.28.0",
26110
26110
  "eslint-config-prettier": "8.5.0",
26111
26111
  "eslint-plugin-import": "2.26.0",
26112
26112
  "eslint-plugin-node": "11.1.0",
@@ -26375,6 +26375,8 @@ var _default = (0, _keymirror.default)({
26375
26375
  // webcam is recording
26376
26376
  STOPPING: null,
26377
26377
  // recording is being stopped (= preview)
26378
+ STOPPED: null,
26379
+ // recording has stopped
26378
26380
  PROGRESS: null,
26379
26381
  // start sending
26380
26382
  BEGIN_AUDIO_ENCODING: null,
@@ -26614,6 +26616,10 @@ var _default = {
26614
26616
  // define default FROM email address
26615
26617
  to: null,
26616
26618
  // define default TO email address
26619
+ cc: null,
26620
+ // define default CC email address
26621
+ bcc: null,
26622
+ // define default BCC email address
26617
26623
  subject: null,
26618
26624
  // define default subject line
26619
26625
  body: null // define default body content
@@ -28450,8 +28456,6 @@ Object.defineProperty(exports, "__esModule", {
28450
28456
  value: true
28451
28457
  });
28452
28458
  exports.default = void 0;
28453
- _dereq_("core-js/modules/es.regexp.exec.js");
28454
- _dereq_("core-js/modules/es.string.replace.js");
28455
28459
  _dereq_("core-js/modules/es.array.for-each.js");
28456
28460
  _dereq_("core-js/modules/es.object.to-string.js");
28457
28461
  _dereq_("core-js/modules/web.dom-collections.for-each.js");
@@ -28635,42 +28639,8 @@ var Container = function Container(options) {
28635
28639
  function hideMySelf() {
28636
28640
  (0, _hidden.default)(containerElement, true);
28637
28641
  }
28638
-
28639
- // fixes https://github.com/binarykitchen/videomail-client/issues/71
28640
- function trimEmail(email) {
28641
- return email.replace(/(^[,\s]+)|([,\s]+$)/g, '');
28642
- }
28643
28642
  function submitVideomail(formData, method, cb) {
28644
- var FORM_FIELDS = {
28645
- subject: options.selectors.subjectInputName,
28646
- from: options.selectors.fromInputName,
28647
- to: options.selectors.toInputName,
28648
- cc: options.selectors.ccInputName,
28649
- bcc: options.selectors.bccInputName,
28650
- body: options.selectors.bodyInputName,
28651
- key: options.selectors.keyInputName,
28652
- parentKey: options.selectors.parentKeyInputName,
28653
- sendCopy: options.selectors.sendCopyInputName
28654
- };
28655
- var videomailFormData = {};
28656
- Object.keys(FORM_FIELDS).forEach(function (key) {
28657
- var formFieldValue = FORM_FIELDS[key];
28658
- if (formFieldValue in formData) {
28659
- videomailFormData[key] = formData[formFieldValue];
28660
- }
28661
- });
28662
- if (videomailFormData.from) {
28663
- videomailFormData.from = trimEmail(videomailFormData.from);
28664
- }
28665
- if (videomailFormData.to) {
28666
- videomailFormData.to = trimEmail(videomailFormData.to);
28667
- }
28668
- if (videomailFormData.cc) {
28669
- videomailFormData.cc = trimEmail(videomailFormData.cc);
28670
- }
28671
- if (videomailFormData.bcc) {
28672
- videomailFormData.bcc = trimEmail(videomailFormData.bcc);
28673
- }
28643
+ var videomailFormData = form.transformFormData(formData);
28674
28644
 
28675
28645
  // when method is undefined, treat it as a post
28676
28646
  if (isPost(method) || !method) {
@@ -28947,6 +28917,54 @@ var Container = function Container(options) {
28947
28917
  whyInvalid = 'Form input(s() are invalid';
28948
28918
  }
28949
28919
  }
28920
+
28921
+ // TODO CONTINUE FROM HERE, MAKE VALIDATION CLEVER WHEN AUTOMATIC SO THAT IT REQUIRES AT
28922
+ // LEAST ONE RECIPIENT AMONG TO/CC/BCC
28923
+ if (valid) {
28924
+ var _recipients$to, _recipients$cc, _recipients$bcc;
28925
+ // If CC and/or BCC exist, validate one more time to ensure at least
28926
+ // one recipient is given
28927
+ var recipients = form.getRecipients();
28928
+ var toIsConfigured = ('to' in recipients);
28929
+ var ccIsConfigured = ('cc' in recipients);
28930
+ var bccIsConfigured = ('bcc' in recipients);
28931
+ var hasTo = ((_recipients$to = recipients.to) === null || _recipients$to === void 0 ? void 0 : _recipients$to.length) > 0;
28932
+ var hasCc = ((_recipients$cc = recipients.cc) === null || _recipients$cc === void 0 ? void 0 : _recipients$cc.length) > 0;
28933
+ var hasBcc = ((_recipients$bcc = recipients.bcc) === null || _recipients$bcc === void 0 ? void 0 : _recipients$bcc.length) > 0;
28934
+ if (toIsConfigured) {
28935
+ if (!hasTo) {
28936
+ if (ccIsConfigured && bccIsConfigured) {
28937
+ if (!hasCc && !hasBcc) {
28938
+ valid = false;
28939
+ }
28940
+ } else if (ccIsConfigured) {
28941
+ if (!hasCc) {
28942
+ valid = false;
28943
+ }
28944
+ } else if (bccIsConfigured) {
28945
+ if (!hasBcc) {
28946
+ valid = false;
28947
+ }
28948
+ } else {
28949
+ whyInvalid = 'Please configure the form to have at least one recipient.';
28950
+ }
28951
+ }
28952
+ } else if (ccIsConfigured) {
28953
+ if (!hasCc) {
28954
+ if (bccIsConfigured) {
28955
+ if (!hasBcc) {
28956
+ valid = false;
28957
+ }
28958
+ }
28959
+ }
28960
+ }
28961
+ if (!valid) {
28962
+ whyInvalid = 'Please enter at least one recipient.';
28963
+ }
28964
+ console.log({
28965
+ recipients: recipients
28966
+ });
28967
+ }
28950
28968
  } else {
28951
28969
  valid = visualsValid;
28952
28970
  }
@@ -29074,7 +29092,7 @@ _util.default.inherits(Container, _eventEmitter.default);
29074
29092
  var _default = Container;
29075
29093
  exports.default = _default;
29076
29094
 
29077
- },{"../../styles/css/main.min.css.js":376,"../events":348,"../resource":350,"../util/eventEmitter":354,"../util/videomailError":359,"./buttons":360,"./dimension":362,"./form":363,"./optionsWrapper":364,"./visuals":365,"@babel/runtime/helpers/interopRequireDefault":1,"core-js/modules/es.array.for-each.js":202,"core-js/modules/es.object.define-property.js":208,"core-js/modules/es.object.keys.js":210,"core-js/modules/es.object.to-string.js":211,"core-js/modules/es.regexp.exec.js":221,"core-js/modules/es.string.replace.js":224,"core-js/modules/web.dom-collections.for-each.js":249,"document-visibility":260,"element-closest":262,"hidden":281,"insert-css":287,"util":338}],362:[function(_dereq_,module,exports){
29095
+ },{"../../styles/css/main.min.css.js":376,"../events":348,"../resource":350,"../util/eventEmitter":354,"../util/videomailError":359,"./buttons":360,"./dimension":362,"./form":363,"./optionsWrapper":364,"./visuals":365,"@babel/runtime/helpers/interopRequireDefault":1,"core-js/modules/es.array.for-each.js":202,"core-js/modules/es.object.define-property.js":208,"core-js/modules/es.object.keys.js":210,"core-js/modules/es.object.to-string.js":211,"core-js/modules/web.dom-collections.for-each.js":249,"document-visibility":260,"element-closest":262,"hidden":281,"insert-css":287,"util":338}],362:[function(_dereq_,module,exports){
29078
29096
  "use strict";
29079
29097
 
29080
29098
  _dereq_("core-js/modules/es.object.define-property.js");
@@ -29198,6 +29216,12 @@ Object.defineProperty(exports, "__esModule", {
29198
29216
  value: true
29199
29217
  });
29200
29218
  exports.default = void 0;
29219
+ _dereq_("core-js/modules/es.regexp.exec.js");
29220
+ _dereq_("core-js/modules/es.string.replace.js");
29221
+ _dereq_("core-js/modules/es.array.for-each.js");
29222
+ _dereq_("core-js/modules/es.object.to-string.js");
29223
+ _dereq_("core-js/modules/web.dom-collections.for-each.js");
29224
+ _dereq_("core-js/modules/es.object.keys.js");
29201
29225
  var _getFormData = _interopRequireDefault(_dereq_("get-form-data"));
29202
29226
  var _hidden = _interopRequireDefault(_dereq_("hidden"));
29203
29227
  var _hyperscript = _interopRequireDefault(_dereq_("hyperscript"));
@@ -29205,6 +29229,10 @@ var _util = _interopRequireDefault(_dereq_("util"));
29205
29229
  var _events = _interopRequireDefault(_dereq_("../events"));
29206
29230
  var _eventEmitter = _interopRequireDefault(_dereq_("../util/eventEmitter"));
29207
29231
  var _videomailError = _interopRequireDefault(_dereq_("../util/videomailError"));
29232
+ // fixes https://github.com/binarykitchen/videomail-client/issues/71
29233
+ function trimEmail(email) {
29234
+ return email.replace(/(^[,\s]+)|([,\s]+$)/g, '');
29235
+ }
29208
29236
  var Form = function Form(container, formElement, options) {
29209
29237
  _eventEmitter.default.call(this, options, 'Form');
29210
29238
  var self = this;
@@ -29214,6 +29242,53 @@ var Form = function Form(container, formElement, options) {
29214
29242
  includeDisabled: true
29215
29243
  });
29216
29244
  }
29245
+ this.transformFormData = function (formData) {
29246
+ var FORM_FIELDS = {
29247
+ subject: options.selectors.subjectInputName,
29248
+ from: options.selectors.fromInputName,
29249
+ to: options.selectors.toInputName,
29250
+ cc: options.selectors.ccInputName,
29251
+ bcc: options.selectors.bccInputName,
29252
+ body: options.selectors.bodyInputName,
29253
+ key: options.selectors.keyInputName,
29254
+ parentKey: options.selectors.parentKeyInputName,
29255
+ sendCopy: options.selectors.sendCopyInputName
29256
+ };
29257
+ var transformedFormData = {};
29258
+ Object.keys(FORM_FIELDS).forEach(function (key) {
29259
+ var formFieldValue = FORM_FIELDS[key];
29260
+ if (formFieldValue in formData) {
29261
+ transformedFormData[key] = formData[formFieldValue];
29262
+ }
29263
+ });
29264
+ if (transformedFormData.from) {
29265
+ transformedFormData.from = trimEmail(transformedFormData.from);
29266
+ }
29267
+ if (transformedFormData.to) {
29268
+ transformedFormData.to = trimEmail(transformedFormData.to);
29269
+ }
29270
+ if (transformedFormData.cc) {
29271
+ transformedFormData.cc = trimEmail(transformedFormData.cc);
29272
+ }
29273
+ if (transformedFormData.bcc) {
29274
+ transformedFormData.bcc = trimEmail(transformedFormData.bcc);
29275
+ }
29276
+ return transformedFormData;
29277
+ };
29278
+ this.getRecipients = function () {
29279
+ var videomailFormData = this.transformFormData(getData());
29280
+ var recipients = {};
29281
+ if ('to' in videomailFormData) {
29282
+ recipients.to = videomailFormData.to;
29283
+ }
29284
+ if ('cc' in videomailFormData) {
29285
+ recipients.cc = videomailFormData.cc;
29286
+ }
29287
+ if ('bcc' in videomailFormData) {
29288
+ recipients.bcc = videomailFormData.bcc;
29289
+ }
29290
+ return recipients;
29291
+ };
29217
29292
  this.loadVideomail = function (videomail) {
29218
29293
  var limit = formElement.elements.length;
29219
29294
  var input;
@@ -29383,7 +29458,7 @@ _util.default.inherits(Form, _eventEmitter.default);
29383
29458
  var _default = Form;
29384
29459
  exports.default = _default;
29385
29460
 
29386
- },{"../events":348,"../util/eventEmitter":354,"../util/videomailError":359,"@babel/runtime/helpers/interopRequireDefault":1,"core-js/modules/es.object.define-property.js":208,"get-form-data":271,"hidden":281,"hyperscript":283,"util":338}],364:[function(_dereq_,module,exports){
29461
+ },{"../events":348,"../util/eventEmitter":354,"../util/videomailError":359,"@babel/runtime/helpers/interopRequireDefault":1,"core-js/modules/es.array.for-each.js":202,"core-js/modules/es.object.define-property.js":208,"core-js/modules/es.object.keys.js":210,"core-js/modules/es.object.to-string.js":211,"core-js/modules/es.regexp.exec.js":221,"core-js/modules/es.string.replace.js":224,"core-js/modules/web.dom-collections.for-each.js":249,"get-form-data":271,"hidden":281,"hyperscript":283,"util":338}],364:[function(_dereq_,module,exports){
29387
29462
  "use strict";
29388
29463
 
29389
29464
  _dereq_("core-js/modules/es.object.define-property.js");
@@ -31041,8 +31116,8 @@ var Recorder = function Recorder(visuals, replay) {
31041
31116
  args: args
31042
31117
  };
31043
31118
 
31044
- // todo commented out because for some reasons server does not accept such a long
31045
- // array of many log lines. to examine later.
31119
+ // todo commented out because for some reasons server does
31120
+ // not accept such a long array of many log lines. to examine later.
31046
31121
  //
31047
31122
  // add some useful debug info to examine weird stuff like this one
31048
31123
  // UnprocessableError: Unable to encode a video with FPS near zero.
@@ -31124,7 +31199,11 @@ var Recorder = function Recorder(visuals, replay) {
31124
31199
  recordingStats.samplesCount = samplesCount;
31125
31200
  recordingStats.sampleRate = userMedia.getAudioSampleRate();
31126
31201
  }
31127
- writeCommand('stop', recordingStats);
31202
+ writeCommand('stop', recordingStats, function () {
31203
+ self.emit(_events.default.STOPPED, {
31204
+ recordingStats: recordingStats
31205
+ });
31206
+ });
31128
31207
 
31129
31208
  // beware, resetting will set framesCount to zero, so leave this here
31130
31209
  self.reset();