videomail-client 9.2.23 → 9.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
@@ -1,6 +1,7 @@
1
1
  # videomail-client ✉
2
2
 
3
- [![Build Status](https://travis-ci.org/binarykitchen/videomail-client.svg?branch=master)](https://travis-ci.org/binarykitchen/videomail-client)
3
+ [![Test Runner for videomail-client](https://github.com/binarykitchen/videomail-client/actions/workflows/push.yml/badge.svg)](https://github.com/binarykitchen/videomail-client/actions/workflows/push.yml)
4
+
4
5
  [![npm][npm-image]][npm-url]
5
6
  [![downloads][downloads-image]][downloads-url]
6
7
  [![browserstack][browserstack-image]][browserstack-url]
@@ -58,16 +59,16 @@ That's it. Easy as apple pie.
58
59
  <div id="videomail"></div>
59
60
  <script src="/js/videomail-client.js"></script>
60
61
  <script>
61
- var VideomailClient = require('videomail-client'), // load videomail client package
62
+ var VideomailClient = require("videomail-client"), // load videomail client package
62
63
  videomailClient = new VideomailClient({
63
64
  // instantiate with some options
64
65
  verbose: true, // prints additional info to console
65
- disableSubmit: true // disable submissions to keep example simple
66
- })
66
+ disableSubmit: true, // disable submissions to keep example simple
67
+ });
67
68
 
68
69
  // this will load your webcam, fill the placeholder containing
69
70
  // the `id="videomail"` with HTML and CSS code, place buttons and much more.
70
- videomailClient.show()
71
+ videomailClient.show();
71
72
  </script>
72
73
  </body>
73
74
  </html>
@@ -126,7 +127,7 @@ Looking at the examples in the `/prototype` folder should give you some ideas ho
126
127
  The constructor accepts a JSON with optional <a href="#options">options</a>. Example:
127
128
 
128
129
  ```js
129
- var videomailClient = new VideomailClient({ siteName: 'my site name' })
130
+ var videomailClient = new VideomailClient({ siteName: "my site name" });
130
131
  ```
131
132
 
132
133
  <a name="on"></a>
@@ -136,11 +137,11 @@ var videomailClient = new VideomailClient({ siteName: 'my site name' })
136
137
  The VideomailClient class is inherited from EventEmitter and emits lots of useful events for your app. Here an example:
137
138
 
138
139
  ```js
139
- videomailClient.on('FORM_READY', function () {
140
+ videomailClient.on("FORM_READY", function () {
140
141
  // form is ready for recording
141
- })
142
+ });
142
143
 
143
- videomailClient.on('SUBMITTED', function (videomail, response) {
144
+ videomailClient.on("SUBMITTED", function (videomail, response) {
144
145
  // continue with your own app logic in your javascript code if you want to process
145
146
  // something else further after form submission.
146
147
  //
@@ -151,7 +152,7 @@ videomailClient.on('SUBMITTED', function (videomail, response) {
151
152
  //
152
153
  // but if you want all that videomail meta data to be submitted in the form already,
153
154
  // enable the `submitWithVideomail` option.
154
- })
155
+ });
155
156
  ```
156
157
 
157
158
  #### Supported events:
@@ -216,7 +217,7 @@ An utility function which returns true if the current browser is capable of webc
216
217
  Manually unloads the webcam and all other internal event listeners. Can be used in conjunction with single page apps, for example with AngularJS' destroy event:
217
218
 
218
219
  ```js
219
- $scope.$on('$destroy', videomailClient.unload.bind(videomailClient))
220
+ $scope.$on("$destroy", videomailClient.unload.bind(videomailClient));
220
221
  ```
221
222
 
222
223
  <a name="hide"></a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "9.2.23",
3
+ "version": "9.3.0",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -44,15 +44,15 @@
44
44
  "@babel/core": "7.25.2",
45
45
  "add-eventlistener-with-options": "1.25.5",
46
46
  "animitter": "3.0.0",
47
- "audio-sample": "4.0.1",
48
- "canvas-to-buffer": "4.0.1",
47
+ "audio-sample": "4.1.0",
48
+ "canvas-to-buffer": "4.1.0",
49
49
  "classlist.js": "1.1.20150312",
50
50
  "contains": "0.1.1",
51
51
  "core-js": "3.38.1",
52
52
  "create-error": "0.3.1",
53
53
  "deepmerge": "4.3.1",
54
54
  "defined": "1.0.1",
55
- "despot": "2.0.0",
55
+ "despot": "2.1.0",
56
56
  "document-visibility": "1.0.1",
57
57
  "filesize": "10.1.6",
58
58
  "format-util": "1.0.5",
@@ -79,7 +79,7 @@
79
79
  "audit-ci": "7.1.0",
80
80
  "autoprefixer": "10.4.20",
81
81
  "babelify": "10.0.0",
82
- "body-parser": "1.20.2",
82
+ "body-parser": "1.20.3",
83
83
  "browserify": "17.0.0",
84
84
  "connect-send-json": "1.0.0",
85
85
  "cssnano": "6.0.5",
@@ -123,8 +123,8 @@
123
123
  "watchify": "4.0.0"
124
124
  },
125
125
  "engines": {
126
- "node": "^20.16.0",
127
- "npm": "^10.8.1"
126
+ "node": ">=20.16.0",
127
+ "npm": ">=10.8.1"
128
128
  },
129
129
  "readmeFilename": "README.md"
130
130
  }
@@ -9567,20 +9567,24 @@ var isArray = Array.isArray;
9567
9567
 
9568
9568
  var defaults = {
9569
9569
  allowDots: false,
9570
+ allowEmptyArrays: false,
9570
9571
  allowPrototypes: false,
9571
9572
  allowSparse: false,
9572
9573
  arrayLimit: 20,
9573
9574
  charset: 'utf-8',
9574
9575
  charsetSentinel: false,
9575
9576
  comma: false,
9577
+ decodeDotInKeys: false,
9576
9578
  decoder: utils.decode,
9577
9579
  delimiter: '&',
9578
9580
  depth: 5,
9581
+ duplicates: 'combine',
9579
9582
  ignoreQueryPrefix: false,
9580
9583
  interpretNumericEntities: false,
9581
9584
  parameterLimit: 1000,
9582
9585
  parseArrays: true,
9583
9586
  plainObjects: false,
9587
+ strictDepth: false,
9584
9588
  strictNullHandling: false
9585
9589
  };
9586
9590
 
@@ -9609,8 +9613,10 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
9609
9613
  var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
9610
9614
 
9611
9615
  var parseValues = function parseQueryStringValues(str, options) {
9612
- var obj = {};
9616
+ var obj = { __proto__: null };
9617
+
9613
9618
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
9619
+ cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
9614
9620
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
9615
9621
  var parts = cleanStr.split(options.delimiter, limit);
9616
9622
  var skipIndex = -1; // Keep track of where the utf8 sentinel was found
@@ -9662,9 +9668,10 @@ var parseValues = function parseQueryStringValues(str, options) {
9662
9668
  val = isArray(val) ? [val] : val;
9663
9669
  }
9664
9670
 
9665
- if (has.call(obj, key)) {
9671
+ var existing = has.call(obj, key);
9672
+ if (existing && options.duplicates === 'combine') {
9666
9673
  obj[key] = utils.combine(obj[key], val);
9667
- } else {
9674
+ } else if (!existing || options.duplicates === 'last') {
9668
9675
  obj[key] = val;
9669
9676
  }
9670
9677
  }
@@ -9680,24 +9687,27 @@ var parseObject = function (chain, val, options, valuesParsed) {
9680
9687
  var root = chain[i];
9681
9688
 
9682
9689
  if (root === '[]' && options.parseArrays) {
9683
- obj = [].concat(leaf);
9690
+ obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
9691
+ ? []
9692
+ : [].concat(leaf);
9684
9693
  } else {
9685
9694
  obj = options.plainObjects ? Object.create(null) : {};
9686
9695
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
9687
- var index = parseInt(cleanRoot, 10);
9688
- if (!options.parseArrays && cleanRoot === '') {
9696
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
9697
+ var index = parseInt(decodedRoot, 10);
9698
+ if (!options.parseArrays && decodedRoot === '') {
9689
9699
  obj = { 0: leaf };
9690
9700
  } else if (
9691
9701
  !isNaN(index)
9692
- && root !== cleanRoot
9693
- && String(index) === cleanRoot
9702
+ && root !== decodedRoot
9703
+ && String(index) === decodedRoot
9694
9704
  && index >= 0
9695
9705
  && (options.parseArrays && index <= options.arrayLimit)
9696
9706
  ) {
9697
9707
  obj = [];
9698
9708
  obj[index] = leaf;
9699
- } else if (cleanRoot !== '__proto__') {
9700
- obj[cleanRoot] = leaf;
9709
+ } else if (decodedRoot !== '__proto__') {
9710
+ obj[decodedRoot] = leaf;
9701
9711
  }
9702
9712
  }
9703
9713
 
@@ -9752,9 +9762,12 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars
9752
9762
  keys.push(segment[1]);
9753
9763
  }
9754
9764
 
9755
- // If there's a remainder, just add whatever is left
9765
+ // If there's a remainder, check strictDepth option for throw, else just add whatever is left
9756
9766
 
9757
9767
  if (segment) {
9768
+ if (options.strictDepth === true) {
9769
+ throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
9770
+ }
9758
9771
  keys.push('[' + key.slice(segment.index) + ']');
9759
9772
  }
9760
9773
 
@@ -9766,7 +9779,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
9766
9779
  return defaults;
9767
9780
  }
9768
9781
 
9769
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
9782
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
9783
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
9784
+ }
9785
+
9786
+ if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
9787
+ throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
9788
+ }
9789
+
9790
+ if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
9770
9791
  throw new TypeError('Decoder has to be a function.');
9771
9792
  }
9772
9793
 
@@ -9775,23 +9796,35 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
9775
9796
  }
9776
9797
  var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
9777
9798
 
9799
+ var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
9800
+
9801
+ if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
9802
+ throw new TypeError('The duplicates option must be either combine, first, or last');
9803
+ }
9804
+
9805
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
9806
+
9778
9807
  return {
9779
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
9808
+ allowDots: allowDots,
9809
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
9780
9810
  allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
9781
9811
  allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
9782
9812
  arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
9783
9813
  charset: charset,
9784
9814
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
9785
9815
  comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
9816
+ decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
9786
9817
  decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
9787
9818
  delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
9788
9819
  // eslint-disable-next-line no-implicit-coercion, no-extra-parens
9789
9820
  depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
9821
+ duplicates: duplicates,
9790
9822
  ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
9791
9823
  interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
9792
9824
  parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
9793
9825
  parseArrays: opts.parseArrays !== false,
9794
9826
  plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
9827
+ strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
9795
9828
  strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
9796
9829
  };
9797
9830
  };
@@ -9844,7 +9877,6 @@ var arrayPrefixGenerators = {
9844
9877
  };
9845
9878
 
9846
9879
  var isArray = Array.isArray;
9847
- var split = String.prototype.split;
9848
9880
  var push = Array.prototype.push;
9849
9881
  var pushToArray = function (arr, valueOrArray) {
9850
9882
  push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
@@ -9856,10 +9888,13 @@ var defaultFormat = formats['default'];
9856
9888
  var defaults = {
9857
9889
  addQueryPrefix: false,
9858
9890
  allowDots: false,
9891
+ allowEmptyArrays: false,
9892
+ arrayFormat: 'indices',
9859
9893
  charset: 'utf-8',
9860
9894
  charsetSentinel: false,
9861
9895
  delimiter: '&',
9862
9896
  encode: true,
9897
+ encodeDotInKeys: false,
9863
9898
  encoder: utils.encode,
9864
9899
  encodeValuesOnly: false,
9865
9900
  format: defaultFormat,
@@ -9888,8 +9923,10 @@ var stringify = function stringify(
9888
9923
  prefix,
9889
9924
  generateArrayPrefix,
9890
9925
  commaRoundTrip,
9926
+ allowEmptyArrays,
9891
9927
  strictNullHandling,
9892
9928
  skipNulls,
9929
+ encodeDotInKeys,
9893
9930
  encoder,
9894
9931
  filter,
9895
9932
  sort,
@@ -9946,14 +9983,6 @@ var stringify = function stringify(
9946
9983
  if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
9947
9984
  if (encoder) {
9948
9985
  var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
9949
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
9950
- var valuesArray = split.call(String(obj), ',');
9951
- var valuesJoined = '';
9952
- for (var i = 0; i < valuesArray.length; ++i) {
9953
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
9954
- }
9955
- return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
9956
- }
9957
9986
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
9958
9987
  }
9959
9988
  return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -9968,6 +9997,9 @@ var stringify = function stringify(
9968
9997
  var objKeys;
9969
9998
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
9970
9999
  // we need to join elements in
10000
+ if (encodeValuesOnly && encoder) {
10001
+ obj = utils.maybeMap(obj, encoder);
10002
+ }
9971
10003
  objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
9972
10004
  } else if (isArray(filter)) {
9973
10005
  objKeys = filter;
@@ -9976,7 +10008,13 @@ var stringify = function stringify(
9976
10008
  objKeys = sort ? keys.sort(sort) : keys;
9977
10009
  }
9978
10010
 
9979
- var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
10011
+ var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
10012
+
10013
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
10014
+
10015
+ if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
10016
+ return adjustedPrefix + '[]';
10017
+ }
9980
10018
 
9981
10019
  for (var j = 0; j < objKeys.length; ++j) {
9982
10020
  var key = objKeys[j];
@@ -9986,9 +10024,10 @@ var stringify = function stringify(
9986
10024
  continue;
9987
10025
  }
9988
10026
 
10027
+ var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
9989
10028
  var keyPrefix = isArray(obj)
9990
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
9991
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
10029
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
10030
+ : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
9992
10031
 
9993
10032
  sideChannel.set(object, step);
9994
10033
  var valueSideChannel = getSideChannel();
@@ -9998,9 +10037,11 @@ var stringify = function stringify(
9998
10037
  keyPrefix,
9999
10038
  generateArrayPrefix,
10000
10039
  commaRoundTrip,
10040
+ allowEmptyArrays,
10001
10041
  strictNullHandling,
10002
10042
  skipNulls,
10003
- encoder,
10043
+ encodeDotInKeys,
10044
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
10004
10045
  filter,
10005
10046
  sort,
10006
10047
  allowDots,
@@ -10021,6 +10062,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
10021
10062
  return defaults;
10022
10063
  }
10023
10064
 
10065
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
10066
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
10067
+ }
10068
+
10069
+ if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
10070
+ throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
10071
+ }
10072
+
10024
10073
  if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
10025
10074
  throw new TypeError('Encoder has to be a function.');
10026
10075
  }
@@ -10044,13 +10093,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
10044
10093
  filter = opts.filter;
10045
10094
  }
10046
10095
 
10096
+ var arrayFormat;
10097
+ if (opts.arrayFormat in arrayPrefixGenerators) {
10098
+ arrayFormat = opts.arrayFormat;
10099
+ } else if ('indices' in opts) {
10100
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
10101
+ } else {
10102
+ arrayFormat = defaults.arrayFormat;
10103
+ }
10104
+
10105
+ if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
10106
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
10107
+ }
10108
+
10109
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
10110
+
10047
10111
  return {
10048
10112
  addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
10049
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
10113
+ allowDots: allowDots,
10114
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
10115
+ arrayFormat: arrayFormat,
10050
10116
  charset: charset,
10051
10117
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
10118
+ commaRoundTrip: opts.commaRoundTrip,
10052
10119
  delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
10053
10120
  encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
10121
+ encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
10054
10122
  encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
10055
10123
  encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
10056
10124
  filter: filter,
@@ -10084,20 +10152,8 @@ module.exports = function (object, opts) {
10084
10152
  return '';
10085
10153
  }
10086
10154
 
10087
- var arrayFormat;
10088
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
10089
- arrayFormat = opts.arrayFormat;
10090
- } else if (opts && 'indices' in opts) {
10091
- arrayFormat = opts.indices ? 'indices' : 'repeat';
10092
- } else {
10093
- arrayFormat = 'indices';
10094
- }
10095
-
10096
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
10097
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
10098
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
10099
- }
10100
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
10155
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
10156
+ var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
10101
10157
 
10102
10158
  if (!objKeys) {
10103
10159
  objKeys = Object.keys(obj);
@@ -10119,8 +10175,10 @@ module.exports = function (object, opts) {
10119
10175
  key,
10120
10176
  generateArrayPrefix,
10121
10177
  commaRoundTrip,
10178
+ options.allowEmptyArrays,
10122
10179
  options.strictNullHandling,
10123
10180
  options.skipNulls,
10181
+ options.encodeDotInKeys,
10124
10182
  options.encode ? options.encoder : null,
10125
10183
  options.filter,
10126
10184
  options.sort,
@@ -10275,6 +10333,10 @@ var decode = function (str, decoder, charset) {
10275
10333
  }
10276
10334
  };
10277
10335
 
10336
+ var limit = 1024;
10337
+
10338
+ /* eslint operator-linebreak: [2, "before"] */
10339
+
10278
10340
  var encode = function encode(str, defaultEncoder, charset, kind, format) {
10279
10341
  // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
10280
10342
  // It has been adapted here for stricter adherence to RFC 3986
@@ -10296,45 +10358,54 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
10296
10358
  }
10297
10359
 
10298
10360
  var out = '';
10299
- for (var i = 0; i < string.length; ++i) {
10300
- var c = string.charCodeAt(i);
10301
-
10302
- if (
10303
- c === 0x2D // -
10304
- || c === 0x2E // .
10305
- || c === 0x5F // _
10306
- || c === 0x7E // ~
10307
- || (c >= 0x30 && c <= 0x39) // 0-9
10308
- || (c >= 0x41 && c <= 0x5A) // a-z
10309
- || (c >= 0x61 && c <= 0x7A) // A-Z
10310
- || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
10311
- ) {
10312
- out += string.charAt(i);
10313
- continue;
10314
- }
10361
+ for (var j = 0; j < string.length; j += limit) {
10362
+ var segment = string.length >= limit ? string.slice(j, j + limit) : string;
10363
+ var arr = [];
10364
+
10365
+ for (var i = 0; i < segment.length; ++i) {
10366
+ var c = segment.charCodeAt(i);
10367
+ if (
10368
+ c === 0x2D // -
10369
+ || c === 0x2E // .
10370
+ || c === 0x5F // _
10371
+ || c === 0x7E // ~
10372
+ || (c >= 0x30 && c <= 0x39) // 0-9
10373
+ || (c >= 0x41 && c <= 0x5A) // a-z
10374
+ || (c >= 0x61 && c <= 0x7A) // A-Z
10375
+ || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
10376
+ ) {
10377
+ arr[arr.length] = segment.charAt(i);
10378
+ continue;
10379
+ }
10315
10380
 
10316
- if (c < 0x80) {
10317
- out = out + hexTable[c];
10318
- continue;
10319
- }
10381
+ if (c < 0x80) {
10382
+ arr[arr.length] = hexTable[c];
10383
+ continue;
10384
+ }
10320
10385
 
10321
- if (c < 0x800) {
10322
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
10323
- continue;
10324
- }
10386
+ if (c < 0x800) {
10387
+ arr[arr.length] = hexTable[0xC0 | (c >> 6)]
10388
+ + hexTable[0x80 | (c & 0x3F)];
10389
+ continue;
10390
+ }
10325
10391
 
10326
- if (c < 0xD800 || c >= 0xE000) {
10327
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
10328
- continue;
10392
+ if (c < 0xD800 || c >= 0xE000) {
10393
+ arr[arr.length] = hexTable[0xE0 | (c >> 12)]
10394
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
10395
+ + hexTable[0x80 | (c & 0x3F)];
10396
+ continue;
10397
+ }
10398
+
10399
+ i += 1;
10400
+ c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
10401
+
10402
+ arr[arr.length] = hexTable[0xF0 | (c >> 18)]
10403
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
10404
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
10405
+ + hexTable[0x80 | (c & 0x3F)];
10329
10406
  }
10330
10407
 
10331
- i += 1;
10332
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
10333
- /* eslint operator-linebreak: [2, "before"] */
10334
- out += hexTable[0xF0 | (c >> 18)]
10335
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
10336
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
10337
- + hexTable[0x80 | (c & 0x3F)];
10408
+ out += arr.join('');
10338
10409
  }
10339
10410
 
10340
10411
  return out;
@@ -17268,7 +17339,7 @@ function wrappy (fn, cb) {
17268
17339
  },{}],116:[function(_dereq_,module,exports){
17269
17340
  module.exports={
17270
17341
  "name": "videomail-client",
17271
- "version": "9.2.23",
17342
+ "version": "9.3.0",
17272
17343
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
17273
17344
  "keywords": [
17274
17345
  "webcam",
@@ -17312,15 +17383,15 @@ module.exports={
17312
17383
  "@babel/core": "7.25.2",
17313
17384
  "add-eventlistener-with-options": "1.25.5",
17314
17385
  "animitter": "3.0.0",
17315
- "audio-sample": "4.0.1",
17316
- "canvas-to-buffer": "4.0.1",
17386
+ "audio-sample": "4.1.0",
17387
+ "canvas-to-buffer": "4.1.0",
17317
17388
  "classlist.js": "1.1.20150312",
17318
17389
  "contains": "0.1.1",
17319
17390
  "core-js": "3.38.1",
17320
17391
  "create-error": "0.3.1",
17321
17392
  "deepmerge": "4.3.1",
17322
17393
  "defined": "1.0.1",
17323
- "despot": "2.0.0",
17394
+ "despot": "2.1.0",
17324
17395
  "document-visibility": "1.0.1",
17325
17396
  "filesize": "10.1.6",
17326
17397
  "format-util": "1.0.5",
@@ -17347,7 +17418,7 @@ module.exports={
17347
17418
  "audit-ci": "7.1.0",
17348
17419
  "autoprefixer": "10.4.20",
17349
17420
  "babelify": "10.0.0",
17350
- "body-parser": "1.20.2",
17421
+ "body-parser": "1.20.3",
17351
17422
  "browserify": "17.0.0",
17352
17423
  "connect-send-json": "1.0.0",
17353
17424
  "cssnano": "6.0.5",
@@ -17391,8 +17462,8 @@ module.exports={
17391
17462
  "watchify": "4.0.0"
17392
17463
  },
17393
17464
  "engines": {
17394
- "node": "^20.16.0",
17395
- "npm": "^10.8.1"
17465
+ "node": ">=20.16.0",
17466
+ "npm": ">=10.8.1"
17396
17467
  },
17397
17468
  "readmeFilename": "README.md"
17398
17469
  }
@@ -19066,7 +19137,7 @@ VideomailError.create = function (err, explanation, options, parameters) {
19066
19137
  break;
19067
19138
  case VideomailError.STARTING_FAILED:
19068
19139
  message = "Starting video failed";
19069
- explanation = "Most likely this happens when the webcam is already active in another browser.";
19140
+ explanation = "Most likely this happens when the webcam is already active in another browser";
19070
19141
  classList.push(VideomailError.WEBCAM_PROBLEM);
19071
19142
  break;
19072
19143
  case "DevicesNotFoundError":
@@ -19077,12 +19148,12 @@ VideomailError.create = function (err, explanation, options, parameters) {
19077
19148
  case VideomailError.NOT_READABLE_ERROR:
19078
19149
  case VideomailError.TRACK_START_ERROR:
19079
19150
  message = "No access to webcam";
19080
- explanation = "A hardware error occurred which prevented access to your webcam.";
19151
+ explanation = "A hardware error occurred which prevented access to your webcam";
19081
19152
  classList.push(VideomailError.WEBCAM_PROBLEM);
19082
19153
  break;
19083
19154
  case VideomailError.INVALID_STATE_ERROR:
19084
19155
  message = "Invalid state";
19085
- explanation = "Video recording stream from your webcam already has finished.";
19156
+ explanation = "Video recording stream from your webcam already has finished";
19086
19157
  classList.push(VideomailError.WEBCAM_PROBLEM);
19087
19158
  break;
19088
19159
  case VideomailError.DOM_EXCEPTION:
@@ -19102,7 +19173,7 @@ VideomailError.create = function (err, explanation, options, parameters) {
19102
19173
  }
19103
19174
  case 11:
19104
19175
  message = "Invalid State";
19105
- explanation = "The object is in an invalid, unusable state.";
19176
+ explanation = "The object is in an invalid, unusable state";
19106
19177
  classList.push(VideomailError.BROWSER_PROBLEM);
19107
19178
  break;
19108
19179
  default:
@@ -22282,15 +22353,19 @@ var Recorder = function Recorder(visuals, replay) {
22282
22353
 
22283
22354
  stream.on("close", function (err) {
22284
22355
  debug("".concat(PIPE_SYMBOL, "Stream has closed"));
22356
+ connecting = connected = false;
22285
22357
  if (err) {
22286
- connecting = connected = false;
22287
22358
  self.emit(_events.default.ERROR, err || "Unhandled websocket error");
22288
22359
  } else {
22289
22360
  // COMMENTED OUT TEMPORARILY, PROBABLY OLD CODE TOO
22290
22361
  // UPON CLOSE IT SHOULD TRY TO RECONNECT INSTEAD OF DISCONNECT.
22362
+
22291
22363
  // self.emit(Events.DISCONNECTED);
22292
22364
  // // prevents from https://github.com/binarykitchen/videomail.io/issues/297 happening
22293
22365
  // cancelAnimationFrame();
22366
+
22367
+ // New: try to reconnect
22368
+ initSocket();
22294
22369
  }
22295
22370
  });
22296
22371
  stream.on("connect", function () {
@@ -22317,7 +22392,7 @@ var Recorder = function Recorder(visuals, replay) {
22317
22392
  }
22318
22393
  });
22319
22394
  stream.on("error", function (err) {
22320
- debug("".concat(PIPE_SYMBOL, "Stream *error* event emitted: ").concat(err.message));
22395
+ debug("".concat(PIPE_SYMBOL, "Stream *error* event emitted: ").concat((0, _safeJsonStringify.default)(err)));
22321
22396
 
22322
22397
  // OLD CODE, COMMENTED OUT TEMPORARILY FOR INVESTIGATIONS
22323
22398
  // IT SHOULD RECONNECT INSTEAD OF CLOSING THE CONNECTION