videomail-client 9.2.14 → 9.2.16
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
|
@@ -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.
|
|
17270
|
+
"version": "9.2.16",
|
|
17271
17271
|
"description": "A wicked npm package to record videos directly in the browser, wohooo!",
|
|
17272
17272
|
"keywords": [
|
|
17273
17273
|
"webcam",
|
|
@@ -18257,7 +18257,6 @@ var Browser = function Browser(options) {
|
|
|
18257
18257
|
var osVersion = parseFloat(uaParser.os.version);
|
|
18258
18258
|
var isWindows = uaParser.os.name === "Windows";
|
|
18259
18259
|
var isEdge = uaParser.browser.name === "Edge" || isWindows && osVersion >= 10;
|
|
18260
|
-
var isIE = /IE/.test(uaParser.browser.name);
|
|
18261
18260
|
var isSafari = /Safari/.test(uaParser.browser.name);
|
|
18262
18261
|
var isOpera = /Opera/.test(uaParser.browser.name);
|
|
18263
18262
|
var isAndroid = /Android/.test(uaParser.os.name);
|
|
@@ -18289,8 +18288,6 @@ var Browser = function Browser(options) {
|
|
|
18289
18288
|
}
|
|
18290
18289
|
} else if (isChromium) {
|
|
18291
18290
|
warning = "Probably you need to <a href=\"".concat(chromiumDownload, "\" target=\"_blank\">") + "upgrade Chromium</a> to fix this.";
|
|
18292
|
-
} else if (isIE) {
|
|
18293
|
-
warning = "Instead of Internet Explorer you need to upgrade to" + " <a href=\"".concat(edgeDownload, "\" target=\"_blank\">Edge</a>.");
|
|
18294
18291
|
} else if (isOkSafari) {
|
|
18295
18292
|
warning = "Probably you need to shut down Safari and restart it, this for correct webcam access.";
|
|
18296
18293
|
} else if (isSafari) {
|
|
@@ -20278,24 +20275,16 @@ var Container = function Container(options) {
|
|
|
20278
20275
|
var whyInvalid;
|
|
20279
20276
|
var invalidData;
|
|
20280
20277
|
if (form) {
|
|
20281
|
-
|
|
20282
|
-
if (
|
|
20283
|
-
|
|
20284
|
-
|
|
20285
|
-
|
|
20286
|
-
|
|
20287
|
-
|
|
20288
|
-
|
|
20289
|
-
|
|
20290
|
-
|
|
20291
|
-
}
|
|
20292
|
-
} else {
|
|
20293
|
-
var invalidInput = form.getInvalidElement();
|
|
20294
|
-
if (invalidInput) {
|
|
20295
|
-
whyInvalid = "Input \"".concat(invalidInput.name, "\" seems wrong \uD83E\uDD14");
|
|
20296
|
-
invalidData = (0, _defineProperty2.default)({}, invalidInput.name, invalidInput.value);
|
|
20297
|
-
} else {
|
|
20298
|
-
whyInvalid = "Unknown form input(s) are invalid";
|
|
20278
|
+
var invalidInput = form.getInvalidElement();
|
|
20279
|
+
if (invalidInput) {
|
|
20280
|
+
valid = false;
|
|
20281
|
+
whyInvalid = "Input \"".concat(invalidInput.name, "\" seems wrong \uD83E\uDD14");
|
|
20282
|
+
invalidData = (0, _defineProperty2.default)({}, invalidInput.name, invalidInput.value);
|
|
20283
|
+
} else if (!areVisualsHidden() && !visualsValid) {
|
|
20284
|
+
// TODO Improve this check to have this based on `key`
|
|
20285
|
+
if (buttonsAreReady() || self.isRecording() || self.isPaused() || self.isCountingDown()) {
|
|
20286
|
+
valid = false;
|
|
20287
|
+
whyInvalid = "Don't forget to record a video 😉";
|
|
20299
20288
|
}
|
|
20300
20289
|
}
|
|
20301
20290
|
if (valid) {
|
|
@@ -20712,11 +20701,22 @@ var Form = function Form(container, formElement, options) {
|
|
|
20712
20701
|
}
|
|
20713
20702
|
(0, _hidden.default)(formElement, true);
|
|
20714
20703
|
}
|
|
20715
|
-
function
|
|
20716
|
-
|
|
20704
|
+
function isRegisteredFormField(formElement) {
|
|
20705
|
+
var formElementName = formElement.name;
|
|
20706
|
+
var registeredFormFieldNames = Object.values(FORM_FIELDS);
|
|
20707
|
+
var isRegistered = registeredFormFieldNames.includes(formElementName);
|
|
20708
|
+
return isRegistered;
|
|
20717
20709
|
}
|
|
20718
|
-
function
|
|
20719
|
-
|
|
20710
|
+
function getRegisteredFormElements() {
|
|
20711
|
+
var elements = formElement.querySelectorAll("input, textarea, select");
|
|
20712
|
+
var registeredElements = [];
|
|
20713
|
+
for (var i = 0; i < elements.length; i++) {
|
|
20714
|
+
var element = elements[i];
|
|
20715
|
+
if (isRegisteredFormField(element)) {
|
|
20716
|
+
registeredElements.push(element);
|
|
20717
|
+
}
|
|
20718
|
+
}
|
|
20719
|
+
return registeredElements;
|
|
20720
20720
|
}
|
|
20721
20721
|
this.disable = function (buttonsToo) {
|
|
20722
20722
|
setDisabled(true, buttonsToo);
|
|
@@ -20724,12 +20724,6 @@ var Form = function Form(container, formElement, options) {
|
|
|
20724
20724
|
this.enable = function (buttonsToo) {
|
|
20725
20725
|
setDisabled(false, buttonsToo);
|
|
20726
20726
|
};
|
|
20727
|
-
function isRegisteredFormField(formElement) {
|
|
20728
|
-
var formElementName = formElement.name;
|
|
20729
|
-
var registeredFormFieldNames = Object.values(FORM_FIELDS);
|
|
20730
|
-
var isRegistered = registeredFormFieldNames.includes(formElementName);
|
|
20731
|
-
return isRegistered;
|
|
20732
|
-
}
|
|
20733
20727
|
this.build = function () {
|
|
20734
20728
|
debug("Form: build()");
|
|
20735
20729
|
keyInput = formElement.querySelector("input[name=\"".concat(options.selectors.keyInputName, "\"]"));
|
|
@@ -20741,27 +20735,14 @@ var Form = function Form(container, formElement, options) {
|
|
|
20741
20735
|
formElement.appendChild(keyInput);
|
|
20742
20736
|
}
|
|
20743
20737
|
if (options.enableAutoValidation) {
|
|
20744
|
-
var inputElements =
|
|
20738
|
+
var inputElements = getRegisteredFormElements();
|
|
20745
20739
|
for (var i = 0, len = inputElements.length; i < len; i++) {
|
|
20746
20740
|
var inputElement = inputElements[i];
|
|
20747
|
-
|
|
20748
|
-
|
|
20749
|
-
|
|
20750
|
-
|
|
20751
|
-
|
|
20752
|
-
inputElement.addEventListener("change", container.validate);
|
|
20753
|
-
} else {
|
|
20754
|
-
inputElement.addEventListener("input", container.validate);
|
|
20755
|
-
}
|
|
20756
|
-
}
|
|
20757
|
-
}
|
|
20758
|
-
var selectElements = getSelectElements();
|
|
20759
|
-
for (var j = 0, len2 = selectElements.length; j < len2; j++) {
|
|
20760
|
-
var selectElement = selectElements[j];
|
|
20761
|
-
|
|
20762
|
-
// Only listen to form selects we are interested in, ignore the others
|
|
20763
|
-
if (isRegisteredFormField(selectElement)) {
|
|
20764
|
-
selectElement.addEventListener("change", container.validate);
|
|
20741
|
+
var type = inputElement.type;
|
|
20742
|
+
if (type === "radio" || type === "select") {
|
|
20743
|
+
inputElement.addEventListener("change", container.validate);
|
|
20744
|
+
} else {
|
|
20745
|
+
inputElement.addEventListener("input", container.validate);
|
|
20765
20746
|
}
|
|
20766
20747
|
}
|
|
20767
20748
|
}
|
|
@@ -20817,19 +20798,16 @@ var Form = function Form(container, formElement, options) {
|
|
|
20817
20798
|
});
|
|
20818
20799
|
};
|
|
20819
20800
|
function removeAllInputListeners() {
|
|
20820
|
-
var inputElements =
|
|
20801
|
+
var inputElements = getRegisteredFormElements();
|
|
20821
20802
|
for (var i = 0, len = inputElements.length; i < len; i++) {
|
|
20822
20803
|
var inputElement = inputElements[i];
|
|
20823
|
-
|
|
20804
|
+
var type = inputElement.type;
|
|
20805
|
+
if (type === "radio" || type === "select") {
|
|
20824
20806
|
inputElement.removeEventListener("change", container.validate);
|
|
20825
20807
|
} else {
|
|
20826
20808
|
inputElement.removeEventListener("input", container.validate);
|
|
20827
20809
|
}
|
|
20828
20810
|
}
|
|
20829
|
-
var selectElements = getSelectElements();
|
|
20830
|
-
for (var j = 0, len2 = selectElements.length; j < len2; j++) {
|
|
20831
|
-
selectElements[j].removeEventListener("change", container.validate);
|
|
20832
|
-
}
|
|
20833
20811
|
}
|
|
20834
20812
|
function hideSubmitButton() {
|
|
20835
20813
|
var submitButton = self.findSubmitButton();
|
|
@@ -20867,26 +20845,15 @@ var Form = function Form(container, formElement, options) {
|
|
|
20867
20845
|
return false; // important to stop submission
|
|
20868
20846
|
};
|
|
20869
20847
|
this.getInvalidElement = function () {
|
|
20870
|
-
var inputElements =
|
|
20848
|
+
var inputElements = getRegisteredFormElements();
|
|
20871
20849
|
var i = 0;
|
|
20872
20850
|
for (var len = inputElements.length; i < len; i++) {
|
|
20873
20851
|
if (!inputElements[i].validity.valid) {
|
|
20874
20852
|
return inputElements[i];
|
|
20875
20853
|
}
|
|
20876
20854
|
}
|
|
20877
|
-
var selectElements = getSelectElements();
|
|
20878
|
-
var j = 0;
|
|
20879
|
-
for (var len2 = selectElements.length; j < len2; j++) {
|
|
20880
|
-
if (!selectElements[j].validity.valid) {
|
|
20881
|
-
return selectElements[j];
|
|
20882
|
-
}
|
|
20883
|
-
}
|
|
20884
20855
|
return null;
|
|
20885
20856
|
};
|
|
20886
|
-
this.validate = function () {
|
|
20887
|
-
var formIsValid = formElement.checkValidity();
|
|
20888
|
-
return formIsValid;
|
|
20889
|
-
};
|
|
20890
20857
|
this.findSubmitButton = function () {
|
|
20891
20858
|
return formElement.querySelector("[type='submit']");
|
|
20892
20859
|
};
|
|
@@ -22149,8 +22116,11 @@ var Recorder = function Recorder(visuals, replay) {
|
|
|
22149
22116
|
}
|
|
22150
22117
|
}
|
|
22151
22118
|
function clearRetryTimeout() {
|
|
22119
|
+
if (!retryTimeout) {
|
|
22120
|
+
return;
|
|
22121
|
+
}
|
|
22152
22122
|
debug("Recorder: clearRetryTimeout()");
|
|
22153
|
-
|
|
22123
|
+
clearTimeout(retryTimeout);
|
|
22154
22124
|
retryTimeout = null;
|
|
22155
22125
|
}
|
|
22156
22126
|
function calculateFrameProgress() {
|