idmission-web-sdk 1.0.269 → 1.0.271

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.
@@ -51,7 +51,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
51
51
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
52
52
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
53
53
 
54
- var webSdkVersion = '1.0.269';
54
+ var webSdkVersion = '1.0.271';
55
55
 
56
56
  function getPlatform() {
57
57
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -13638,7 +13638,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13638
13638
  height = _l.height;
13639
13639
  var signaturePad = React.useRef(null);
13640
13640
  var signatureRecorder = React.useRef(null);
13641
- var recordedChunks = React.useRef([]);
13641
+ // const recordedChunks = useRef<BlobPart[]>([])
13642
13642
  var onPredictionMade = React.useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
13643
13643
  var _m = useVideoRecorder(cameraRef.current),
13644
13644
  isRecording = _m.isRecording,
@@ -13651,8 +13651,8 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13651
13651
  signatureDataUrl = _p[0],
13652
13652
  setSignatureDataUrl = _p[1];
13653
13653
  var _q = React.useState(null),
13654
- signatureVideoData = _q[0],
13655
- setSignatureVideoData = _q[1];
13654
+ signatureVideoData = _q[0];
13655
+ _q[1];
13656
13656
  colors.guidanceMessageBackgroundColor || (colors.guidanceMessageBackgroundColor = '#ccc');
13657
13657
  colors.guidanceMessageTextColor || (colors.guidanceMessageTextColor = 'black');
13658
13658
  var verbiage = useTranslations(rawVerbiage, {
@@ -13667,7 +13667,6 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13667
13667
  recordingLock.current = true;
13668
13668
  (function () {
13669
13669
  return tslib.__awaiter(void 0, void 0, void 0, function () {
13670
- var stream;
13671
13670
  return tslib.__generator(this, function (_a) {
13672
13671
  switch (_a.label) {
13673
13672
  case 0:
@@ -13685,24 +13684,6 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13685
13684
  _a.label = 2;
13686
13685
  case 2:
13687
13686
  startRecording();
13688
- stream = outputCanvas.current.captureStream(24 /* fps */);
13689
- signatureRecorder.current = new MediaRecorder(stream, {
13690
- videoBitsPerSecond: 270000
13691
- });
13692
- signatureRecorder.current.start();
13693
- signatureRecorder.current.ondataavailable = function (event) {
13694
- var _a;
13695
- recordedChunks.current.push(event.data);
13696
- if (((_a = signatureRecorder.current) === null || _a === void 0 ? void 0 : _a.state) === 'recording') {
13697
- signatureRecorder.current.stop();
13698
- }
13699
- };
13700
- signatureRecorder.current.onstop = function () {
13701
- var blob = new Blob(recordedChunks.current, {
13702
- type: 'video/mp4'
13703
- });
13704
- setSignatureVideoData(blob);
13705
- };
13706
13687
  return [2 /*return*/];
13707
13688
  }
13708
13689
  });
@@ -13730,19 +13711,26 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13730
13711
  if (!ctx) return;
13731
13712
  animationFrame.current = requestAnimationFrame(function runFrame() {
13732
13713
  return tslib.__awaiter(this, void 0, void 0, function () {
13733
- var rect;
13734
13714
  return tslib.__generator(this, function (_a) {
13735
13715
  if (!signaturePad.current || !videoRef.current || !outputCanvas.current) {
13736
13716
  cancelAnimationFrame(animationFrame.current);
13737
13717
  return [2 /*return*/];
13738
13718
  }
13739
- rect = [w * (isPortrait ? 0.02 : 0.15), h * (isPortrait ? 0.15 : 0.25), w * (isPortrait ? 0.96 : 0.7), h * (isPortrait ? 0.7 : 0.5)];
13740
- ctx.drawImage(videoRef.current, 0, 0, w, h);
13741
- ctx.beginPath();
13742
- ctx.fillStyle = 'rgba(255,255,255,0.5)';
13743
- ctx.roundRect.apply(ctx, tslib.__spreadArray(tslib.__spreadArray([], rect, false), [16], false));
13744
- ctx.fill();
13745
- ctx.drawImage.apply(ctx, tslib.__spreadArray([signaturePad.current.getCanvas()], rect, false));
13719
+ // const rect: [number, number, number, number] = [
13720
+ // w * (isPortrait ? 0.02 : 0.15),
13721
+ // h * (isPortrait ? 0.15 : 0.25),
13722
+ // w * (isPortrait ? 0.96 : 0.7),
13723
+ // h * (isPortrait ? 0.7 : 0.5),
13724
+ // ]
13725
+ //
13726
+ // ctx.drawImage(videoRef.current, 0, 0, w, h)
13727
+ //
13728
+ // ctx.beginPath()
13729
+ // ctx.fillStyle = 'rgba(255,255,255,0.5)'
13730
+ // ctx.roundRect(...rect, 16)
13731
+ // ctx.fill()
13732
+ //
13733
+ // ctx.drawImage(signaturePad.current.getCanvas(), ...rect)
13746
13734
  animationFrame.current = requestAnimationFrame(runFrame);
13747
13735
  return [2 /*return*/];
13748
13736
  });