idmission-web-sdk 2.3.94 → 2.3.96
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/components/video_signature_capture/VideoSignatureContext.d.ts +5 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +14 -79
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +14 -79
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +129 -2894
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -6,10 +6,12 @@ export type VideoSignatureMetadata = {
|
|
|
6
6
|
mimeType?: string;
|
|
7
7
|
mediaInfo?: MediaInfoResult;
|
|
8
8
|
timingData?: {
|
|
9
|
+
recordingStartRequestedAt?: number;
|
|
9
10
|
recordingStartedAt?: number;
|
|
10
11
|
firstChunkReceivedAt?: number;
|
|
11
12
|
signatureStartedAt?: number;
|
|
12
13
|
signatureEndedAt?: number;
|
|
14
|
+
recordingStopRequestedAt?: number;
|
|
13
15
|
lastChunkReceivedAt?: number;
|
|
14
16
|
recordingStoppedAt?: number;
|
|
15
17
|
};
|
|
@@ -19,10 +21,12 @@ export type VideoSignatureState = {
|
|
|
19
21
|
startRecording: (captureAudio?: boolean) => void;
|
|
20
22
|
stopRecording: (signatureData?: SignatureData, signatureImage?: string | null) => void;
|
|
21
23
|
clearRecordedData: () => void;
|
|
24
|
+
recordingStartRequestedAt?: number;
|
|
22
25
|
recordingStartedAt?: number;
|
|
23
|
-
recordingStoppedAt?: number;
|
|
24
26
|
firstChunkReceivedAt?: number;
|
|
27
|
+
recordingStopRequestedAt?: number;
|
|
25
28
|
lastChunkReceivedAt?: number;
|
|
29
|
+
recordingStoppedAt?: number;
|
|
26
30
|
signaturePad: React.RefObject<SignatureCanvas>;
|
|
27
31
|
outputCanvas: React.RefObject<HTMLCanvasElement>;
|
|
28
32
|
signaturePadEmpty: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoSignatureContext.d.ts","sourceRoot":"","sources":["../../../src/components/video_signature_capture/VideoSignatureContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,eAAe,MAAM,wBAAwB,CAAA;AAWpD,OAAO,KAAK,EAAiB,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAY7E,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,UAAU,CAAC,EAAE;QACX,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,mBAAmB,CAAC,EAAE,MAAM,CAAA;QAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAC5B,CAAA;CACF,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,SAAS,EAAE,IAAI,EACf,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,MAAM,GAAG,IAAI,EACjC,QAAQ,EAAE,sBAAsB,KAC7B,IAAI,CAAA;AAET,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAChD,aAAa,EAAE,CACb,aAAa,CAAC,EAAE,aAAa,EAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,KAC3B,IAAI,CAAA;IACT,iBAAiB,EAAE,MAAM,IAAI,CAAA;IAE7B,
|
|
1
|
+
{"version":3,"file":"VideoSignatureContext.d.ts","sourceRoot":"","sources":["../../../src/components/video_signature_capture/VideoSignatureContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,eAAe,MAAM,wBAAwB,CAAA;AAWpD,OAAO,KAAK,EAAiB,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAY7E,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,UAAU,CAAC,EAAE;QACX,yBAAyB,CAAC,EAAE,MAAM,CAAA;QAClC,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,wBAAwB,CAAC,EAAE,MAAM,CAAA;QACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;QAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAC5B,CAAA;CACF,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,SAAS,EAAE,IAAI,EACf,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,MAAM,GAAG,IAAI,EACjC,QAAQ,EAAE,sBAAsB,KAC7B,IAAI,CAAA;AAET,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAChD,aAAa,EAAE,CACb,aAAa,CAAC,EAAE,aAAa,EAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,KAC3B,IAAI,CAAA;IACT,iBAAiB,EAAE,MAAM,IAAI,CAAA;IAE7B,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IAC9C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAA;IAEhD,iBAAiB,EAAE,OAAO,CAAA;IAC1B,cAAc,EAAE,OAAO,CAAA;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;IAE/B,wBAAwB,EAAE,wBAAwB,CAAA;CACnD,CAAA;AAaD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;EAoHlC,CAAA;AAiCD,MAAM,CAAC,OAAO,UAAU,6BAA6B,CAAC,EACpD,QAAQ,EACR,gBAAwB,GACzB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,qBA8IA"}
|
|
@@ -238,7 +238,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
238
238
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
var webSdkVersion = '2.3.
|
|
241
|
+
var webSdkVersion = '2.3.96';
|
|
242
242
|
|
|
243
243
|
function getPlatform() {
|
|
244
244
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -14392,9 +14392,9 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14392
14392
|
videoBitsPerSecond: 650000,
|
|
14393
14393
|
audioBitsPerSecond: 32000
|
|
14394
14394
|
});
|
|
14395
|
-
signatureRecorder.onstart = function () {
|
|
14395
|
+
signatureRecorder.onstart = function (e) {
|
|
14396
14396
|
set({
|
|
14397
|
-
recordingStartedAt:
|
|
14397
|
+
recordingStartedAt: e.timeStamp
|
|
14398
14398
|
});
|
|
14399
14399
|
};
|
|
14400
14400
|
var hasFirstChunk = false;
|
|
@@ -14413,14 +14413,20 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14413
14413
|
}
|
|
14414
14414
|
};
|
|
14415
14415
|
signatureRecorder.start(100);
|
|
14416
|
+
set({
|
|
14417
|
+
recordingStartRequestedAt: performance.now()
|
|
14418
|
+
});
|
|
14416
14419
|
},
|
|
14417
14420
|
stopRecording: function stopRecording(signatureData, imageUrl) {
|
|
14421
|
+
set({
|
|
14422
|
+
recordingStopRequestedAt: performance.now()
|
|
14423
|
+
});
|
|
14418
14424
|
waitForOneMoreChunk().then(function () {
|
|
14419
14425
|
if (!signatureRecorder) return;
|
|
14420
14426
|
signatureRecorder.stop();
|
|
14421
14427
|
signatureRecorder.onstop = function () {
|
|
14422
14428
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
14423
|
-
var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, lastChunkReceivedAt, mediaInfo;
|
|
14429
|
+
var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt, mediaInfo;
|
|
14424
14430
|
var _b;
|
|
14425
14431
|
return __generator(this, function (_c) {
|
|
14426
14432
|
switch (_c.label) {
|
|
@@ -14436,67 +14442,20 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14436
14442
|
signatureChunks = [];
|
|
14437
14443
|
signatureRecorder = null;
|
|
14438
14444
|
if (!signatureData) return [2 /*return*/];
|
|
14439
|
-
_a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
|
|
14440
|
-
return [4 /*yield*/, (_b = get().mediaInfo) === null || _b === void 0 ? void 0 : _b.analyzeData(blob.size, makeReadChunk(blob))
|
|
14441
|
-
// const endMs = Math.min(
|
|
14442
|
-
// signatureEndedAt ?? Infinity,
|
|
14443
|
-
// lastChunkReceivedAt ?? Infinity,
|
|
14444
|
-
// )
|
|
14445
|
-
// const signatureStartTimestamp =
|
|
14446
|
-
// signatureStartedAt && recordingStartedAt
|
|
14447
|
-
// ? formatTimestamp(
|
|
14448
|
-
// Math.max(
|
|
14449
|
-
// 0,
|
|
14450
|
-
// signatureStartedAt -
|
|
14451
|
-
// recordingStartedAt -
|
|
14452
|
-
// RECORDING_TIMESTAMP_PADDING_MS,
|
|
14453
|
-
// ),
|
|
14454
|
-
// )
|
|
14455
|
-
// : undefined
|
|
14456
|
-
// const signatureEndTimestamp =
|
|
14457
|
-
// endMs !== Infinity && recordingStartedAt
|
|
14458
|
-
// ? formatTimestamp(
|
|
14459
|
-
// Math.min(
|
|
14460
|
-
// endMs - recordingStartedAt + RECORDING_TIMESTAMP_PADDING_MS,
|
|
14461
|
-
// lastChunkReceivedAt ?? Infinity,
|
|
14462
|
-
// ),
|
|
14463
|
-
// )
|
|
14464
|
-
// : undefined
|
|
14465
|
-
];
|
|
14445
|
+
_a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
|
|
14446
|
+
return [4 /*yield*/, (_b = get().mediaInfo) === null || _b === void 0 ? void 0 : _b.analyzeData(blob.size, makeReadChunk(blob))];
|
|
14466
14447
|
case 1:
|
|
14467
14448
|
mediaInfo = _c.sent();
|
|
14468
|
-
// const endMs = Math.min(
|
|
14469
|
-
// signatureEndedAt ?? Infinity,
|
|
14470
|
-
// lastChunkReceivedAt ?? Infinity,
|
|
14471
|
-
// )
|
|
14472
|
-
// const signatureStartTimestamp =
|
|
14473
|
-
// signatureStartedAt && recordingStartedAt
|
|
14474
|
-
// ? formatTimestamp(
|
|
14475
|
-
// Math.max(
|
|
14476
|
-
// 0,
|
|
14477
|
-
// signatureStartedAt -
|
|
14478
|
-
// recordingStartedAt -
|
|
14479
|
-
// RECORDING_TIMESTAMP_PADDING_MS,
|
|
14480
|
-
// ),
|
|
14481
|
-
// )
|
|
14482
|
-
// : undefined
|
|
14483
|
-
// const signatureEndTimestamp =
|
|
14484
|
-
// endMs !== Infinity && recordingStartedAt
|
|
14485
|
-
// ? formatTimestamp(
|
|
14486
|
-
// Math.min(
|
|
14487
|
-
// endMs - recordingStartedAt + RECORDING_TIMESTAMP_PADDING_MS,
|
|
14488
|
-
// lastChunkReceivedAt ?? Infinity,
|
|
14489
|
-
// ),
|
|
14490
|
-
// )
|
|
14491
|
-
// : undefined
|
|
14492
14449
|
onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
|
|
14493
14450
|
mediaInfo: mediaInfo,
|
|
14494
14451
|
mimeType: inferredType,
|
|
14495
14452
|
timingData: {
|
|
14453
|
+
recordingStartRequestedAt: recordingStartRequestedAt,
|
|
14496
14454
|
recordingStartedAt: recordingStartedAt,
|
|
14497
14455
|
firstChunkReceivedAt: firstChunkReceivedAt,
|
|
14498
14456
|
signatureStartedAt: signatureStartedAt,
|
|
14499
14457
|
signatureEndedAt: signatureEndedAt,
|
|
14458
|
+
recordingStopRequestedAt: recordingStopRequestedAt,
|
|
14500
14459
|
recordingStoppedAt: recordingStoppedAt,
|
|
14501
14460
|
lastChunkReceivedAt: lastChunkReceivedAt
|
|
14502
14461
|
}
|
|
@@ -14675,14 +14634,6 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14675
14634
|
muted: true,
|
|
14676
14635
|
style: {
|
|
14677
14636
|
display: 'none'
|
|
14678
|
-
// position: 'absolute',
|
|
14679
|
-
// top: 0,
|
|
14680
|
-
// left: 0,
|
|
14681
|
-
// width: '100%',
|
|
14682
|
-
// height: '100%',
|
|
14683
|
-
// zIndex: 1000,
|
|
14684
|
-
// pointerEvents: 'none',
|
|
14685
|
-
// opacity: 0.5,
|
|
14686
14637
|
}
|
|
14687
14638
|
}), /*#__PURE__*/React__namespace.default.createElement(InvisibleCanvas, {
|
|
14688
14639
|
ref: frameCheckCanvas,
|
|
@@ -14694,22 +14645,6 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14694
14645
|
height: (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.videoHeight
|
|
14695
14646
|
}));
|
|
14696
14647
|
}
|
|
14697
|
-
// function formatTimestamp(durationMs: number): string {
|
|
14698
|
-
// // should be in the format of 00:00:00:00 (hh:mm:ss:cs)
|
|
14699
|
-
// const hours = Math.floor(durationMs / 3600000)
|
|
14700
|
-
// const minutes = Math.floor((durationMs % 3600000) / 60000)
|
|
14701
|
-
// const seconds = Math.floor((durationMs % 60000) / 1000)
|
|
14702
|
-
// const milliseconds = durationMs % 1000
|
|
14703
|
-
// // Convert milliseconds to centiseconds (1/100th of a second)
|
|
14704
|
-
// const centiseconds = Math.floor(milliseconds / 10)
|
|
14705
|
-
// const csString = centiseconds.toString().padStart(2, '0')
|
|
14706
|
-
// return (
|
|
14707
|
-
// `${hours.toString().padStart(2, '0')}:` +
|
|
14708
|
-
// `${minutes.toString().padStart(2, '0')}:` +
|
|
14709
|
-
// `${seconds.toString().padStart(2, '0')}:` +
|
|
14710
|
-
// `${csString}`
|
|
14711
|
-
// )
|
|
14712
|
-
// }
|
|
14713
14648
|
function isVideoBlank(video, canvas) {
|
|
14714
14649
|
if (!video || !canvas) return true;
|
|
14715
14650
|
var ctx2 = canvas.getContext('2d');
|