idmission-web-sdk 2.3.82 → 2.3.83

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.
@@ -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.82';
214
+ var webSdkVersion = '2.3.83';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -23566,6 +23566,13 @@
23566
23566
  var AcceptBtn$1 = styled(LoaderButton)(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
23567
23567
  var templateObject_1$c, templateObject_2$b;
23568
23568
 
23569
+ function isBlob(blobPart) {
23570
+ return typeof blobPart === 'object' && 'type' in blobPart;
23571
+ }
23572
+ function inferBlobType(blobPart) {
23573
+ return isBlob(blobPart) ? blobPart.type : undefined;
23574
+ }
23575
+
23569
23576
  var videoRecorder = null;
23570
23577
  var audioRecorder = null;
23571
23578
  var videoChunks = [];
@@ -23699,8 +23706,10 @@
23699
23706
  useVideoRecorderStore.getState().clearRecordedData();
23700
23707
  }, []);
23701
23708
  var processVideo = React.useCallback(function () {
23709
+ var _a;
23710
+ var inferredType = (_a = inferBlobType(videoChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
23702
23711
  var videoBlob = new Blob(videoChunks, {
23703
- type: 'video/mp4'
23712
+ type: inferredType
23704
23713
  });
23705
23714
  useVideoRecorderStore.setState({
23706
23715
  videoUrl: URL.createObjectURL(videoBlob),
@@ -23825,18 +23834,20 @@
23825
23834
  if (!signatureRecorder) return;
23826
23835
  signatureRecorder.stop();
23827
23836
  signatureRecorder.onstop = function () {
23837
+ var _a;
23838
+ var inferredType = (_a = inferBlobType(signatureChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
23828
23839
  var blob = new Blob(signatureChunks, {
23829
- type: 'video/mp4'
23840
+ type: inferredType
23830
23841
  });
23831
23842
  signatureChunks = [];
23832
23843
  signatureRecorder = null;
23833
23844
  if (!signatureData) return;
23834
- var _a = get(),
23835
- onSignatureVideoCaptured = _a.onSignatureVideoCaptured,
23836
- recordingStartedAt = _a.recordingStartedAt,
23837
- signatureStartedAt = _a.signatureStartedAt,
23838
- signatureEndedAt = _a.signatureEndedAt,
23839
- lastChunkReceivedAt = _a.lastChunkReceivedAt;
23845
+ var _b = get(),
23846
+ onSignatureVideoCaptured = _b.onSignatureVideoCaptured,
23847
+ recordingStartedAt = _b.recordingStartedAt,
23848
+ signatureStartedAt = _b.signatureStartedAt,
23849
+ signatureEndedAt = _b.signatureEndedAt,
23850
+ lastChunkReceivedAt = _b.lastChunkReceivedAt;
23840
23851
  var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
23841
23852
  var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
23842
23853
  var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;