easyproctor-hml 2.5.3 → 2.5.4

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/esm/index.js CHANGED
@@ -10168,10 +10168,15 @@ var CameraRecorder = class {
10168
10168
  if (isPortrait && width > height) {
10169
10169
  [width, height] = [height, width];
10170
10170
  }
10171
+ console.log("isPortrait -> ", isPortrait);
10171
10172
  console.log("width -> ", width);
10172
10173
  console.log("height -> ", height);
10173
10174
  console.log("minWidth -> ", this.videoOptions.minWidth);
10174
10175
  console.log("minHeight -> ", this.videoOptions.minHeight);
10176
+ console.log("this.videoOptions.width -> ", this.videoOptions.width);
10177
+ console.log("this.videoOptions.height -> ", this.videoOptions.height);
10178
+ console.log("settings.width -> ", settings.width);
10179
+ console.log("settings.height -> ", settings.height);
10175
10180
  if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
10176
10181
  throw STREAM_UNDER_MINIMUM_PERMITTED;
10177
10182
  } else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
package/index.js CHANGED
@@ -28265,10 +28265,15 @@ var CameraRecorder = class {
28265
28265
  if (isPortrait && width > height) {
28266
28266
  [width, height] = [height, width];
28267
28267
  }
28268
+ console.log("isPortrait -> ", isPortrait);
28268
28269
  console.log("width -> ", width);
28269
28270
  console.log("height -> ", height);
28270
28271
  console.log("minWidth -> ", this.videoOptions.minWidth);
28271
28272
  console.log("minHeight -> ", this.videoOptions.minHeight);
28273
+ console.log("this.videoOptions.width -> ", this.videoOptions.width);
28274
+ console.log("this.videoOptions.height -> ", this.videoOptions.height);
28275
+ console.log("settings.width -> ", settings.width);
28276
+ console.log("settings.height -> ", settings.height);
28272
28277
  if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
28273
28278
  throw STREAM_UNDER_MINIMUM_PERMITTED;
28274
28279
  } else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor-hml",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",
@@ -73,7 +73,7 @@ Minimum version required to store current data is: `+i+`.
73
73
  File size: ${o.size}`),new Error("Failed to upload to AWS")}}async upload(t,r,n){let{file:o,onProgress:i}=t;try{let s=l=>{let h=l.loadedBytes/o.size*100;i&&i(Math.round(h))},a;if(n){if(this.imageBatchNum===this.contImages){let l=[];for(let d=this.imageBatchNum;d<this.imageBatchNum+20;d++)l.push({objectName:`${this.proctoringId}/${this.proctoringId}_${d+1}.jpg`,contentType:"image/jpeg"});(await this.backend.getSignedUrlImage(r,l)).map(d=>{this.imageUrlPackage.push(d)}),this.imageBatchNum+=20}}else a=await this.backend.getSignedUrl(r,o,this.proctoringId);let c=!1;return n?c=await $t.request({url:this.imageUrlPackage[this.contImages],method:"PUT",headers:{"Content-Type":o.type,"x-ms-blob-type":"BlockBlob"},data:o,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(()=>!0).catch(()=>!1).finally(()=>{this.contImages++}):c=await $t.request({url:a,method:"PUT",headers:{"Content-Type":o.type,"x-ms-blob-type":"BlockBlob"},data:o,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(()=>!0).catch(()=>!1),{storage:"upload",url:a,uploaded:c}}catch{throw L.registerError(this.proctoringId,`Failed to upload to AWS
74
74
  File name: ${o.name}
75
75
  File type: ${o.type}
76
- File size: ${o.size}`),new Error("Failed to upload to AWS")}}};var Ig="not_shared_first_screen",Pg="not_shared_screen",la="multiple_monitors_detected",Rg="proctoring_already_started",ha="proctoring_not_started";var Dg="another_stream_active",Og="stream_under_minimum_permitted",Bg="browser_not_supported",Mg="token_missing",Lg="credentials_missing";var Ug="spy_scan_api_not_found";var Fg="external_camera_not_started";var da=class extends qn{constructor(t,r,n="videoPreviewFrameDetection",o="liveViewFrameDetection"){super("ObjectDetector","https://storage.googleapis.com/mediapipe-models/object_detector/efficientdet_lite0/float16/1/efficientdet_lite0.tflite",t,r,n,o)}displayVideoDetections(t){for(let r of this.children)this.liveView.removeChild(r);this.children.splice(0);for(let r of t.detections){let n=window.innerWidth,o=window.innerHeight,i=this.video.offsetWidth,s=this.video.offsetHeight,a=i/n,c=s/o,l=i-r.boundingBox.width*a-r.boundingBox.originX*a,h=r.boundingBox.originY*c,d=(r.boundingBox.width-10)*a,f=r.boundingBox.height*c,b=document.createElement("p");b.innerText=r.categories[0].categoryName+" - with "+Math.round(parseFloat(r.categories[0].score)*100)+"% confidence.",b.style.right=l-20+"px",b.style.top=h+"px",b.style.width=d+"px";let m={zIndex:"2",position:"absolute",border:"1px dashed #fff"};Object.assign(b.style,{...m,margin:"0",fontSize:"9px",paddingBottom:"5px",paddingTop:"5px",color:"#fff",backgroundColor:"#007f8b"});let u=document.createElement("div");u.setAttribute("class","highlighter"),u.style.right=l-20+"px",u.style.top=h+"px",u.style.width=d+"px",u.style.height=f-20+"px",Object.assign(u.style,{...m,zIndex:"1",background:"rgba(0, 255, 0, 0.25)"}),this.liveView.appendChild(u),this.liveView.appendChild(b),this.children.push(u),this.children.push(b)}}verify(t){let r=t.detections.filter(o=>o.categories.some(i=>i.categoryName==="person")).length,n=t.detections.filter(o=>o.categories.some(i=>i.categoryName==="cell phone")).length;this.paramsConfig.videoBehaviourParameters?.detectPerson&&r!==this.numPersonsSent&&(r===0?(this.handleAlert("no_person_detected","person_detection_on_stream"),this.numPersonsSent=r):r>1?(this.handleAlert("multiple_persons_detected","person_detection_on_stream"),this.numPersonsSent=r):(this.handleOk("person_ok","person_detection_on_stream"),this.numPersonsSent=r)),this.paramsConfig.videoBehaviourParameters?.detectCellPhone&&n!==this.numCellphoneSent&&(n>0?(this.handleAlert("cellphone_detected","mobile_detection_on_stream"),this.numCellphoneSent=n):(this.handleOk("cellphone_ok","mobile_detection_on_stream"),this.numCellphoneSent=n))}};var Cr=class{constructor(t){this.volume=null;this.animationFrameId=null;this.stream=t}async start(t={}){return new Promise((r,n)=>{try{let o=new AudioContext;this.analyser=o.createAnalyser();let i=o.createMediaStreamSource(this.stream);this.analyser.smoothingTimeConstant=.8,this.analyser.fftSize=1024,i.connect(this.analyser);let s=()=>{let a=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(a);let l=a.reduce((h,d)=>h+d,0)/a.length;this.setVolume(l),t.setVolume&&t.setVolume(l),this.animationFrameId=requestAnimationFrame(s)};this.animationFrameId=requestAnimationFrame(s),r(!0)}catch(o){this.stop(),n(`Error: ${o}`)}})}stop(){this.animationFrameId!==null&&cancelAnimationFrame(this.animationFrameId)}getVolume(){return this.volume}setVolume(t){this.volume=t}};var sr=class{constructor(t,r,n,o,i){this.blobs=[];this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{frames:40,useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectPerson:!1,detectFace:!1,detectCellPhone:!1}};this.options={cameraId:void 0,microphoneId:void 0,onBufferSizeError:!1,onBufferSizeErrorCallback:t=>{},proctoringType:"IMAGE",onChangeDevicesCallback:t=>{},onRealtimeAlertsCallback:t=>{}};this.videoOptions={width:640,height:480,minWidth:0,minHeight:0};this.blobsRTC=[];this.imageCount=0;this.filesToUpload=[];this.currentRetries=0;this.noiseWait=20;this.options=t,this.videoOptions=r,this.backend=o,this.backendToken=i,n&&(this.paramsConfig=n)}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new ir(this.proctoringId,this.backend)),ca(t)}async initializeDetectors(){Hm(),(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone)&&(this.objectDetection=new da({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.objectDetection.initializeDetector()),this.paramsConfig.videoBehaviourParameters?.detectFace&&(this.faceDetection=new Gn({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.faceDetection.initializeDetector())}configImageCapture(){this.video=document.createElement("video"),this.canvas=document.createElement("canvas"),this.video.srcObject=this.cameraStream,this.video.play(),this.video.muted=!0,this.canvas.width=this.videoOptions.width,this.canvas.height=this.videoOptions.height}async bufferError(t){console.log("buffer error Camera Recorder params "+this.paramsConfig.videoBehaviourParameters);let r=this.paramsConfig.videoBehaviourParameters?.retryEnabled||!1,n=this.paramsConfig.videoBehaviourParameters?.maxRetries||3;r&&this.currentRetries<n?(await this.recordingStop(),await this.startRecording({retry:!0}),this.currentRetries++,this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback(this.cameraStream)):this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback()}async startRecording(t){(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone||this.paramsConfig.videoBehaviourParameters?.detectFace)&&!t?.retry&&await this.initializeDetectors();let{cameraId:r,microphoneId:n,onBufferSizeErrorCallback:o}=this.options,i={audio:{deviceId:n},video:{deviceId:r,width:this.videoOptions.width,height:this.videoOptions.height,frameRate:15}};try{this.cameraStream=await navigator.mediaDevices.getUserMedia(i)}catch(w){throw w.toString()=="NotReadableError: Could not start video source"?"N\xE3o foi poss\xEDvel conectar a camera, ela pode estar sendo utilizada por outro programa":w}let{startRecording:s,stopRecording:a,pauseRecording:c,resumeRecording:l,recorderOptions:h,getBufferSize:d}=Yr(this.cameraStream,this.blobs,this.options.onBufferSizeError,w=>this.bufferError(w),!1);this.recordingStart=s,this.recordingStop=a,this.recordingPause=c,this.recordingResume=l,this.recorderOptions=h,this.getBufferSize=d,this.recordingStart();let b=this.cameraStream.getVideoTracks()[0].getSettings(),{width:m=0,height:u=0}=b;if((screen.orientation?.type.includes("portrait")||window.innerHeight>window.innerWidth)&&m>u&&([m,u]=[u,m]),console.log("width -> ",m),console.log("height -> ",u),console.log("minWidth -> ",this.videoOptions.minWidth),console.log("minHeight -> ",this.videoOptions.minHeight),this.videoOptions.minWidth>m||this.videoOptions.minHeight>u)throw Og;if(this.videoOptions.width!==m||this.videoOptions.height!==u)throw L.registerAnotherStream(this.proctoringId,`Maybe have another stream active
76
+ File size: ${o.size}`),new Error("Failed to upload to AWS")}}};var Ig="not_shared_first_screen",Pg="not_shared_screen",la="multiple_monitors_detected",Rg="proctoring_already_started",ha="proctoring_not_started";var Dg="another_stream_active",Og="stream_under_minimum_permitted",Bg="browser_not_supported",Mg="token_missing",Lg="credentials_missing";var Ug="spy_scan_api_not_found";var Fg="external_camera_not_started";var da=class extends qn{constructor(t,r,n="videoPreviewFrameDetection",o="liveViewFrameDetection"){super("ObjectDetector","https://storage.googleapis.com/mediapipe-models/object_detector/efficientdet_lite0/float16/1/efficientdet_lite0.tflite",t,r,n,o)}displayVideoDetections(t){for(let r of this.children)this.liveView.removeChild(r);this.children.splice(0);for(let r of t.detections){let n=window.innerWidth,o=window.innerHeight,i=this.video.offsetWidth,s=this.video.offsetHeight,a=i/n,c=s/o,l=i-r.boundingBox.width*a-r.boundingBox.originX*a,h=r.boundingBox.originY*c,d=(r.boundingBox.width-10)*a,f=r.boundingBox.height*c,b=document.createElement("p");b.innerText=r.categories[0].categoryName+" - with "+Math.round(parseFloat(r.categories[0].score)*100)+"% confidence.",b.style.right=l-20+"px",b.style.top=h+"px",b.style.width=d+"px";let m={zIndex:"2",position:"absolute",border:"1px dashed #fff"};Object.assign(b.style,{...m,margin:"0",fontSize:"9px",paddingBottom:"5px",paddingTop:"5px",color:"#fff",backgroundColor:"#007f8b"});let u=document.createElement("div");u.setAttribute("class","highlighter"),u.style.right=l-20+"px",u.style.top=h+"px",u.style.width=d+"px",u.style.height=f-20+"px",Object.assign(u.style,{...m,zIndex:"1",background:"rgba(0, 255, 0, 0.25)"}),this.liveView.appendChild(u),this.liveView.appendChild(b),this.children.push(u),this.children.push(b)}}verify(t){let r=t.detections.filter(o=>o.categories.some(i=>i.categoryName==="person")).length,n=t.detections.filter(o=>o.categories.some(i=>i.categoryName==="cell phone")).length;this.paramsConfig.videoBehaviourParameters?.detectPerson&&r!==this.numPersonsSent&&(r===0?(this.handleAlert("no_person_detected","person_detection_on_stream"),this.numPersonsSent=r):r>1?(this.handleAlert("multiple_persons_detected","person_detection_on_stream"),this.numPersonsSent=r):(this.handleOk("person_ok","person_detection_on_stream"),this.numPersonsSent=r)),this.paramsConfig.videoBehaviourParameters?.detectCellPhone&&n!==this.numCellphoneSent&&(n>0?(this.handleAlert("cellphone_detected","mobile_detection_on_stream"),this.numCellphoneSent=n):(this.handleOk("cellphone_ok","mobile_detection_on_stream"),this.numCellphoneSent=n))}};var Cr=class{constructor(t){this.volume=null;this.animationFrameId=null;this.stream=t}async start(t={}){return new Promise((r,n)=>{try{let o=new AudioContext;this.analyser=o.createAnalyser();let i=o.createMediaStreamSource(this.stream);this.analyser.smoothingTimeConstant=.8,this.analyser.fftSize=1024,i.connect(this.analyser);let s=()=>{let a=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(a);let l=a.reduce((h,d)=>h+d,0)/a.length;this.setVolume(l),t.setVolume&&t.setVolume(l),this.animationFrameId=requestAnimationFrame(s)};this.animationFrameId=requestAnimationFrame(s),r(!0)}catch(o){this.stop(),n(`Error: ${o}`)}})}stop(){this.animationFrameId!==null&&cancelAnimationFrame(this.animationFrameId)}getVolume(){return this.volume}setVolume(t){this.volume=t}};var sr=class{constructor(t,r,n,o,i){this.blobs=[];this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{frames:40,useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectPerson:!1,detectFace:!1,detectCellPhone:!1}};this.options={cameraId:void 0,microphoneId:void 0,onBufferSizeError:!1,onBufferSizeErrorCallback:t=>{},proctoringType:"IMAGE",onChangeDevicesCallback:t=>{},onRealtimeAlertsCallback:t=>{}};this.videoOptions={width:640,height:480,minWidth:0,minHeight:0};this.blobsRTC=[];this.imageCount=0;this.filesToUpload=[];this.currentRetries=0;this.noiseWait=20;this.options=t,this.videoOptions=r,this.backend=o,this.backendToken=i,n&&(this.paramsConfig=n)}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new ir(this.proctoringId,this.backend)),ca(t)}async initializeDetectors(){Hm(),(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone)&&(this.objectDetection=new da({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.objectDetection.initializeDetector()),this.paramsConfig.videoBehaviourParameters?.detectFace&&(this.faceDetection=new Gn({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.faceDetection.initializeDetector())}configImageCapture(){this.video=document.createElement("video"),this.canvas=document.createElement("canvas"),this.video.srcObject=this.cameraStream,this.video.play(),this.video.muted=!0,this.canvas.width=this.videoOptions.width,this.canvas.height=this.videoOptions.height}async bufferError(t){console.log("buffer error Camera Recorder params "+this.paramsConfig.videoBehaviourParameters);let r=this.paramsConfig.videoBehaviourParameters?.retryEnabled||!1,n=this.paramsConfig.videoBehaviourParameters?.maxRetries||3;r&&this.currentRetries<n?(await this.recordingStop(),await this.startRecording({retry:!0}),this.currentRetries++,this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback(this.cameraStream)):this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback()}async startRecording(t){(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone||this.paramsConfig.videoBehaviourParameters?.detectFace)&&!t?.retry&&await this.initializeDetectors();let{cameraId:r,microphoneId:n,onBufferSizeErrorCallback:o}=this.options,i={audio:{deviceId:n},video:{deviceId:r,width:this.videoOptions.width,height:this.videoOptions.height,frameRate:15}};try{this.cameraStream=await navigator.mediaDevices.getUserMedia(i)}catch(w){throw w.toString()=="NotReadableError: Could not start video source"?"N\xE3o foi poss\xEDvel conectar a camera, ela pode estar sendo utilizada por outro programa":w}let{startRecording:s,stopRecording:a,pauseRecording:c,resumeRecording:l,recorderOptions:h,getBufferSize:d}=Yr(this.cameraStream,this.blobs,this.options.onBufferSizeError,w=>this.bufferError(w),!1);this.recordingStart=s,this.recordingStop=a,this.recordingPause=c,this.recordingResume=l,this.recorderOptions=h,this.getBufferSize=d,this.recordingStart();let b=this.cameraStream.getVideoTracks()[0].getSettings(),{width:m=0,height:u=0}=b,y=screen.orientation?.type.includes("portrait")||window.innerHeight>window.innerWidth;if(y&&m>u&&([m,u]=[u,m]),console.log("isPortrait -> ",y),console.log("width -> ",m),console.log("height -> ",u),console.log("minWidth -> ",this.videoOptions.minWidth),console.log("minHeight -> ",this.videoOptions.minHeight),console.log("this.videoOptions.width -> ",this.videoOptions.width),console.log("this.videoOptions.height -> ",this.videoOptions.height),console.log("settings.width -> ",b.width),console.log("settings.height -> ",b.height),this.videoOptions.minWidth>m||this.videoOptions.minHeight>u)throw Og;if(this.videoOptions.width!==m||this.videoOptions.height!==u)throw L.registerAnotherStream(this.proctoringId,`Maybe have another stream active
77
77
  Video Options: ${JSON.stringify(this.videoOptions,null,2)}
78
78
  Setting: ${JSON.stringify(b,null,2)}`),Dg;this.paramsConfig.imageBehaviourParameters?.useUploadImage&&this.options.proctoringType=="IMAGE"&&this.photoShotsCycle(),this.paramsConfig.videoBehaviourParameters?.detectFace&&await this.faceDetection.enableCam(this.cameraStream),(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone)&&await this.objectDetection.enableCam(this.cameraStream),this.filesToUpload=[],this.options.proctoringType=="REALTIME"&&this.captureFrame()}async stopRecording(){if(this.recordingStop&&await this.recordingStop(),this.faceDetection&&this.faceDetection.detecting&&this.faceDetection.stopDetection(),this.objectDetection&&this.objectDetection.detecting&&this.objectDetection.stopDetection(),clearInterval(this.imageInterval),clearInterval(this.sendFrameInterval),this.options.proctoringType=="REALTIME"&&this.upload&&this.backendToken){let t=this.filesToUpload.length,r=this.paramsConfig.imageBehaviourParameters.uploadInterval;for(let n=0;n<t;n++){if(n==t-1&&this.filesToUpload[0]){let o=this.filesToUpload[0].name.replace(".jpg","_realtime.jpg"),i=new File([this.filesToUpload[0]],o,{type:"image/jpeg"});this.filesToUpload[0]=i}this.filesToUpload[0]&&await this.upload.uploadImages({file:this.filesToUpload[0]},this.backendToken,r),this.filesToUpload.shift()}}this.volumeMeter&&this.volumeMeter.stop(),this.intervalNoiseDetection&&clearInterval(this.intervalNoiseDetection)}async pauseRecording(){await this.recordingPause()}async resumeRecording(){await this.recordingResume()}photoShotsCycle(){let t;this.configImageCapture(),this.imageInterval=setInterval(async()=>{this.canvas.getContext("2d").drawImage(this.video,0,0,this.videoOptions.width,this.videoOptions.height);let r=this.canvas.toDataURL("image/jpeg");t=await this.getFile(r,`${this.proctoringId}_${this.imageCount+1}.jpg`,"image/jpeg"),t&&this.upload&&this.backendToken&&(this.upload.upload({file:t},this.backendToken,!0),this.imageCount++)},this.paramsConfig.imageBehaviourParameters.uploadInterval*1e3)}captureFrame(){let t;this.configImageCapture();let r=this.paramsConfig.imageBehaviourParameters.uploadInterval,n=!1;this.imageInterval=setInterval(async()=>{this.canvas.getContext("2d").drawImage(this.video,0,0,this.canvas.width,this.canvas.height);let o=this.canvas.toDataURL("image/jpeg");if(this.proctoringId==null)return;n==!1&&r>0&&(n=!0,this.sendFrame());let i=`${this.proctoringId}_${this.imageCount+1}.jpg`;(this.imageCount+1)%r==0&&(i=`${this.proctoringId}_${this.imageCount+1}_realtime.jpg`),t=await this.getFile(o,i,"image/jpeg"),t&&t.size>10&&r>0&&(this.filesToUpload.push(t),this.imageCount++)},1e3)}sendFrame(){let t=this.paramsConfig.imageBehaviourParameters.uploadInterval,r=!1,n=0;this.sendFrameInterval=setInterval(async()=>{if(this.upload&&this.backendToken&&!r){n=0;let o=0,i=this.filesToUpload.length;for(;o<i&&(r=!0,this.filesToUpload.length!=0);)(await this.upload.uploadImages({file:this.filesToUpload[0]},this.backendToken,t)).uploaded==!0?(await this.filesToUpload.shift(),o++):console.log("erro no upload: "+this.filesToUpload[0].name);r=!1}else if(r&&(n++,n==3)){n=0;let o=this.videoOptions.width/2,i=this.videoOptions.height/2;o<320&&(o=320),i<180&&(i=180),this.canvas.width=o,this.canvas.height=i}},t*1e3)}download(t){let r=URL.createObjectURL(t),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=r,n.download=t.name,n.click(),window.URL.revokeObjectURL(r)}async saveOnSession(t){this.blobs!=null&&L.registerSaveOnSession(this.proctoringId,`Blobs Length: ${this.blobs.length} Buffer Size: ${this.getBufferSize()} `);let r=this.cameraStream.getVideoTracks()[0].getSettings(),n=this.cameraStream.getAudioTracks()[0].getSettings();(this.options.proctoringType=="VIDEO"||this.options.proctoringType=="REALTIME"||this.options.proctoringType=="IMAGE"&&this.paramsConfig.imageBehaviourParameters?.saveVideo)&&t.addRecording({device:`Audio
79
79
  Sample Rate: ${n.sampleRate}