gbc-kyc-kit 2.3.16 → 2.3.17
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/dist/gbc-kyc-kit.es.js +43 -8
- package/dist/gbc-kyc-kit.umd.js +40 -40
- package/package.json +1 -1
package/dist/gbc-kyc-kit.es.js
CHANGED
|
@@ -39369,9 +39369,13 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
|
|
|
39369
39369
|
frameRate: {
|
|
39370
39370
|
ideal: 30
|
|
39371
39371
|
},
|
|
39372
|
+
iso: {
|
|
39373
|
+
ideal: 12
|
|
39374
|
+
},
|
|
39372
39375
|
advanced: [{
|
|
39373
|
-
|
|
39376
|
+
zoom: 1
|
|
39374
39377
|
}],
|
|
39378
|
+
focusMode: "continuous",
|
|
39375
39379
|
facingMode: "environment"
|
|
39376
39380
|
}), [isPortrait]);
|
|
39377
39381
|
useEffect(() => {
|
|
@@ -39462,18 +39466,35 @@ function UploadDocument2({
|
|
|
39462
39466
|
}) {
|
|
39463
39467
|
var _a;
|
|
39464
39468
|
const nav = navigator;
|
|
39469
|
+
const [cameras, setCameras] = useState([]);
|
|
39470
|
+
const [currentCameraIndex, setCurrentCameraIndex] = useState(0);
|
|
39471
|
+
useEffect(() => {
|
|
39472
|
+
navigator.mediaDevices.getUserMedia({
|
|
39473
|
+
video: true
|
|
39474
|
+
}).then(() => {
|
|
39475
|
+
return navigator.mediaDevices.enumerateDevices();
|
|
39476
|
+
}).then((devices) => {
|
|
39477
|
+
const videoDevices = devices.filter((device2) => device2.kind === "videoinput");
|
|
39478
|
+
setCameras(videoDevices);
|
|
39479
|
+
}).catch((err) => console.error("Error obteniendo c\xE1maras:", err));
|
|
39480
|
+
}, []);
|
|
39465
39481
|
useEffect(() => {
|
|
39466
39482
|
if (activateCamera && videoRef.current) {
|
|
39483
|
+
cameras[currentCameraIndex];
|
|
39484
|
+
const constraints = videoConstraints;
|
|
39467
39485
|
navigator.mediaDevices.getUserMedia({
|
|
39468
|
-
video:
|
|
39469
|
-
facingMode: "environment"
|
|
39470
|
-
},
|
|
39486
|
+
video: constraints,
|
|
39471
39487
|
audio: false
|
|
39472
39488
|
}).then((stream) => {
|
|
39473
39489
|
if (videoRef.current) {
|
|
39474
39490
|
videoRef.current.srcObject = stream;
|
|
39475
39491
|
videoRef.current.play();
|
|
39476
39492
|
streamRef.current = stream;
|
|
39493
|
+
const track = stream.getVideoTracks()[0];
|
|
39494
|
+
const capabilities = track.getCapabilities();
|
|
39495
|
+
const settings = track.getSettings();
|
|
39496
|
+
console.log("Settings: ", settings);
|
|
39497
|
+
console.log("Capabilities: ", capabilities);
|
|
39477
39498
|
}
|
|
39478
39499
|
}).catch((err) => {
|
|
39479
39500
|
console.error("Error al acceder a la c\xE1mara:", err);
|
|
@@ -39485,7 +39506,10 @@ function UploadDocument2({
|
|
|
39485
39506
|
streamRef.current = null;
|
|
39486
39507
|
}
|
|
39487
39508
|
};
|
|
39488
|
-
}, [activateCamera, videoConstraints]);
|
|
39509
|
+
}, [activateCamera, currentCameraIndex, videoConstraints, cameras]);
|
|
39510
|
+
const handleSwitchCamera = () => {
|
|
39511
|
+
setCurrentCameraIndex((prevIndex) => (prevIndex + 1) % cameras.length);
|
|
39512
|
+
};
|
|
39489
39513
|
(_a = nav.userAgentData) == null ? void 0 : _a.getHighEntropyValues(["model", "platform", "platformVersion", "architecture", "bitness", "fullVersionList"]).then((ua2) => console.log(ua2));
|
|
39490
39514
|
return /* @__PURE__ */ jsx$1("div", {
|
|
39491
39515
|
className: "drag-zone",
|
|
@@ -39501,8 +39525,8 @@ function UploadDocument2({
|
|
|
39501
39525
|
display: "flex",
|
|
39502
39526
|
justifyContent: "center",
|
|
39503
39527
|
alignItems: "center",
|
|
39504
|
-
children: activateCamera ? /* @__PURE__ */
|
|
39505
|
-
children: /* @__PURE__ */ jsx$1("video", {
|
|
39528
|
+
children: activateCamera ? /* @__PURE__ */ jsxs(Box$1, {
|
|
39529
|
+
children: [/* @__PURE__ */ jsx$1("video", {
|
|
39506
39530
|
ref: videoRef,
|
|
39507
39531
|
style: {
|
|
39508
39532
|
width: "100%",
|
|
@@ -39518,7 +39542,18 @@ function UploadDocument2({
|
|
|
39518
39542
|
playsInline: true,
|
|
39519
39543
|
muted: true,
|
|
39520
39544
|
autoPlay: true
|
|
39521
|
-
})
|
|
39545
|
+
}), cameras.length > 1 && /* @__PURE__ */ jsx$1(MUIButton, {
|
|
39546
|
+
onClick: handleSwitchCamera,
|
|
39547
|
+
variant: "contained",
|
|
39548
|
+
size: "small",
|
|
39549
|
+
style: {
|
|
39550
|
+
position: "absolute",
|
|
39551
|
+
top: 10,
|
|
39552
|
+
right: 10,
|
|
39553
|
+
zIndex: 2
|
|
39554
|
+
},
|
|
39555
|
+
children: "Cambiar c\xE1mara"
|
|
39556
|
+
})]
|
|
39522
39557
|
}) : /* @__PURE__ */ jsx$1(InstructionsComponent, {
|
|
39523
39558
|
title,
|
|
39524
39559
|
subtitle
|