idmission-web-sdk 2.3.97 → 2.3.98

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types'), require('mediainfo.js'), require('react-dom/server')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types', 'mediainfo.js', 'react-dom/server'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes, global.mediainfo_js, global.server));
5
- })(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0, mediainfo_js, server) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types'), require('react-dom/server')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types', 'react-dom/server'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes, global.server));
5
+ })(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0, server) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.3.97';
214
+ var webSdkVersion = '2.3.98';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -24200,23 +24200,14 @@
24200
24200
  return t.length > 0 ? t : undefined;
24201
24201
  }
24202
24202
 
24203
- function makeReadChunk(file) {
24204
- var _this = this;
24205
- return function (chunkSize, offset) {
24206
- return __awaiter(_this, void 0, void 0, function () {
24207
- var _a;
24208
- return __generator(this, function (_b) {
24209
- switch (_b.label) {
24210
- case 0:
24211
- _a = Uint8Array.bind;
24212
- return [4 /*yield*/, file.slice(offset, offset + chunkSize).arrayBuffer()];
24213
- case 1:
24214
- return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
24215
- }
24216
- });
24217
- });
24218
- };
24219
- }
24203
+ // import { mediaInfoFactory } from 'mediainfo.js'
24204
+ // import type { ReadChunkFunc, MediaInfo, MediaInfoResult } from 'mediainfo.js'
24205
+ // import { DEFAULT_CDN_URL } from '../common/cdn'
24206
+ // import { warn } from '../../lib/utils/logger'
24207
+ // function makeReadChunk(file: File | Blob): ReadChunkFunc {
24208
+ // return async (chunkSize: number, offset: number) =>
24209
+ // new Uint8Array(await file.slice(offset, offset + chunkSize).arrayBuffer())
24210
+ // }
24220
24211
  var signatureRecorder = null;
24221
24212
  var signatureChunks = [];
24222
24213
  var videoSignatureInitialState = {
@@ -24298,42 +24289,39 @@
24298
24289
  signatureRecorder.stop();
24299
24290
  signatureRecorder.onstop = function () {
24300
24291
  return __awaiter(void 0, void 0, void 0, function () {
24301
- var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt, mediaInfo;
24302
- var _b;
24303
- return __generator(this, function (_c) {
24304
- switch (_c.label) {
24305
- case 0:
24306
- recordingStoppedAt = performance.now();
24307
- set({
24308
- recordingStoppedAt: recordingStoppedAt
24309
- });
24310
- inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
24311
- blob = new Blob(signatureChunks, {
24312
- type: inferredType
24313
- });
24314
- signatureChunks = [];
24315
- signatureRecorder = null;
24316
- if (!signatureData) return [2 /*return*/];
24317
- _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;
24318
- return [4 /*yield*/, (_b = get().mediaInfo) === null || _b === void 0 ? void 0 : _b.analyzeData(blob.size, makeReadChunk(blob))];
24319
- case 1:
24320
- mediaInfo = _c.sent();
24321
- onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
24322
- mediaInfo: mediaInfo,
24323
- mimeType: inferredType,
24324
- timingData: {
24325
- recordingStartRequestedAt: recordingStartRequestedAt,
24326
- recordingStartedAt: recordingStartedAt,
24327
- firstChunkReceivedAt: firstChunkReceivedAt,
24328
- signatureStartedAt: signatureStartedAt,
24329
- signatureEndedAt: signatureEndedAt,
24330
- recordingStopRequestedAt: recordingStopRequestedAt,
24331
- recordingStoppedAt: recordingStoppedAt,
24332
- lastChunkReceivedAt: lastChunkReceivedAt
24333
- }
24334
- });
24335
- return [2 /*return*/];
24336
- }
24292
+ var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt;
24293
+ return __generator(this, function (_b) {
24294
+ recordingStoppedAt = performance.now();
24295
+ set({
24296
+ recordingStoppedAt: recordingStoppedAt
24297
+ });
24298
+ inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
24299
+ blob = new Blob(signatureChunks, {
24300
+ type: inferredType
24301
+ });
24302
+ signatureChunks = [];
24303
+ signatureRecorder = null;
24304
+ if (!signatureData) return [2 /*return*/];
24305
+ _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;
24306
+ // const mediaInfo = await get().mediaInfo?.analyzeData(
24307
+ // blob.size,
24308
+ // makeReadChunk(blob),
24309
+ // )
24310
+ onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
24311
+ // mediaInfo,
24312
+ mimeType: inferredType,
24313
+ timingData: {
24314
+ recordingStartRequestedAt: recordingStartRequestedAt,
24315
+ recordingStartedAt: recordingStartedAt,
24316
+ firstChunkReceivedAt: firstChunkReceivedAt,
24317
+ signatureStartedAt: signatureStartedAt,
24318
+ signatureEndedAt: signatureEndedAt,
24319
+ recordingStopRequestedAt: recordingStopRequestedAt,
24320
+ recordingStoppedAt: recordingStoppedAt,
24321
+ lastChunkReceivedAt: lastChunkReceivedAt
24322
+ }
24323
+ });
24324
+ return [2 /*return*/];
24337
24325
  });
24338
24326
  });
24339
24327
  };
@@ -24383,9 +24371,7 @@
24383
24371
  function VideoSignatureContextProvider(_a) {
24384
24372
  var _this = this;
24385
24373
  var _b, _c, _d, _e;
24386
- var children = _a.children,
24387
- _f = _a.captureMediaInfo,
24388
- captureMediaInfo = _f === void 0 ? false : _f;
24374
+ var children = _a.children;
24389
24375
  var videoRef = useCameraStore().videoRef;
24390
24376
  var outputCanvas = React.useRef(null);
24391
24377
  React.useEffect(function () {
@@ -24395,31 +24381,27 @@
24395
24381
  }, []);
24396
24382
  var signatureVideoRef = React.useRef(null);
24397
24383
  var frameCheckCanvas = React.useRef(null);
24398
- React.useEffect(function () {
24399
- if (!captureMediaInfo) return;
24400
- mediainfo_js.mediaInfoFactory({
24401
- format: 'object',
24402
- full: true,
24403
- locateFile: function locateFile(filename) {
24404
- return "".concat(DEFAULT_CDN_URL, "/").concat(filename);
24405
- }
24406
- }).then(function (mediaInfo) {
24407
- useVideoSignatureStore.setState({
24408
- mediaInfo: mediaInfo
24409
- });
24410
- })["catch"](function (e) {
24411
- warn('error loading mediaInfo', e);
24412
- });
24413
- return function () {
24414
- var mediaInfo = useVideoSignatureStore.getState().mediaInfo;
24415
- if (mediaInfo) {
24416
- mediaInfo.close();
24417
- useVideoSignatureStore.setState({
24418
- mediaInfo: undefined
24419
- });
24420
- }
24421
- };
24422
- }, [captureMediaInfo]);
24384
+ // useEffect(() => {
24385
+ // if (!captureMediaInfo) return
24386
+ // mediaInfoFactory({
24387
+ // format: 'object',
24388
+ // full: true,
24389
+ // locateFile: (filename) => `${DEFAULT_CDN_URL}/${filename}`,
24390
+ // })
24391
+ // .then((mediaInfo) => {
24392
+ // useVideoSignatureStore.setState({ mediaInfo })
24393
+ // })
24394
+ // .catch((e) => {
24395
+ // warn('error loading mediaInfo', e)
24396
+ // })
24397
+ // return () => {
24398
+ // const mediaInfo = useVideoSignatureStore.getState().mediaInfo
24399
+ // if (mediaInfo) {
24400
+ // mediaInfo.close()
24401
+ // useVideoSignatureStore.setState({ mediaInfo: undefined })
24402
+ // }
24403
+ // }
24404
+ // }, [captureMediaInfo])
24423
24405
  var signaturePadEmpty = useVideoSignatureStore().signaturePadEmpty;
24424
24406
  var blankCheckPassed = React.useRef(false);
24425
24407
  React.useEffect(function () {
@@ -24491,9 +24473,9 @@
24491
24473
  video.removeEventListener('play', onPlay);
24492
24474
  };
24493
24475
  }, [drawOutputFrame, videoRef]);
24494
- var _g = useVideoSignatureStore(),
24495
- signaturePad = _g.signaturePad,
24496
- recordingStartedAt = _g.recordingStartedAt;
24476
+ var _f = useVideoSignatureStore(),
24477
+ signaturePad = _f.signaturePad,
24478
+ recordingStartedAt = _f.recordingStartedAt;
24497
24479
  React.useEffect(function () {
24498
24480
  var _a;
24499
24481
  if (!signaturePad.current || !recordingStartedAt) return;