forked from mebjas/html5-qrcode
-
Notifications
You must be signed in to change notification settings - Fork 1
/
utils.js
35 lines (35 loc) · 1.27 KB
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var VideoConstraintsUtil = (function () {
function VideoConstraintsUtil() {
}
VideoConstraintsUtil.isMediaStreamConstraintsValid = function (videoConstraints, logger) {
if (typeof videoConstraints !== "object") {
var typeofVideoConstraints = typeof videoConstraints;
logger.logError("videoConstraints should be of type object, the "
+ ("object passed is of type " + typeofVideoConstraints + "."), true);
return false;
}
var bannedKeys = [
"autoGainControl",
"channelCount",
"echoCancellation",
"latency",
"noiseSuppression",
"sampleRate",
"sampleSize",
"volume"
];
var bannedkeysSet = new Set(bannedKeys);
var keysInVideoConstraints = Object.keys(videoConstraints);
for (var i = 0; i < keysInVideoConstraints.length; i++) {
var key = keysInVideoConstraints[i];
if (bannedkeysSet.has(key)) {
logger.logError(key + " is not supported videoConstaints.", true);
return false;
}
}
return true;
};
return VideoConstraintsUtil;
}());
export { VideoConstraintsUtil };
//# sourceMappingURL=utils.js.map