easyproctor-hml 0.0.70 → 0.0.72
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 +46 -7
- package/index.js +47 -8
- package/package.json +1 -1
- package/proctoring/proctoring.d.ts +1 -0
- package/unpkg/easyproctor.min.js +1 -1
package/esm/index.js
CHANGED
|
@@ -26560,22 +26560,61 @@ Error: ` + error);
|
|
|
26560
26560
|
await this.finish();
|
|
26561
26561
|
console.log("Length:" + this.proctoringSession.recordings.length);
|
|
26562
26562
|
for (let i3 = 0; i3 < this.proctoringSession.recordings.length; i3++) {
|
|
26563
|
+
console.log("baixando " + this.proctoringSession.recordings[i3].device);
|
|
26563
26564
|
this.state = "Stop" /* Stop */;
|
|
26564
26565
|
const file2 = this.proctoringSession.recordings[i3].file;
|
|
26565
26566
|
const url2 = URL.createObjectURL(file2);
|
|
26566
|
-
|
|
26567
|
-
|
|
26568
|
-
|
|
26569
|
-
|
|
26570
|
-
|
|
26571
|
-
|
|
26572
|
-
|
|
26567
|
+
console.log("url2 " + url2);
|
|
26568
|
+
console.log("file2 length " + file2.size);
|
|
26569
|
+
const a4 = document.createElement("a");
|
|
26570
|
+
document.body.appendChild(a4);
|
|
26571
|
+
a4.style.display = "none";
|
|
26572
|
+
a4.href = url2;
|
|
26573
|
+
a4.download = file2.name;
|
|
26574
|
+
a4.click();
|
|
26575
|
+
console.log("click " + this.proctoringSession.recordings[i3].device);
|
|
26576
|
+
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
26577
|
+
setTimeout(function() {
|
|
26578
|
+
window.URL.revokeObjectURL(url2);
|
|
26579
|
+
}, 0);
|
|
26573
26580
|
}
|
|
26581
|
+
for (let i3 = 0; i3 < this.proctoringSession.recordings.length; i3++) {
|
|
26582
|
+
console.log("baixando " + this.proctoringSession.recordings[i3].device);
|
|
26583
|
+
this.state = "Stop" /* Stop */;
|
|
26584
|
+
const currentFile = this.proctoringSession.recordings[i3].file;
|
|
26585
|
+
const file2 = new File([currentFile], currentFile.name);
|
|
26586
|
+
const url2 = URL.createObjectURL(file2);
|
|
26587
|
+
console.log("url2 " + url2);
|
|
26588
|
+
console.log("file2 length " + file2.size);
|
|
26589
|
+
const a4 = document.createElement("a");
|
|
26590
|
+
document.body.appendChild(a4);
|
|
26591
|
+
a4.style.display = "none";
|
|
26592
|
+
a4.href = url2;
|
|
26593
|
+
a4.download = file2.name;
|
|
26594
|
+
a4.click();
|
|
26595
|
+
console.log("click " + this.proctoringSession.recordings[i3].device);
|
|
26596
|
+
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
26597
|
+
setTimeout(function() {
|
|
26598
|
+
window.URL.revokeObjectURL(url2);
|
|
26599
|
+
}, 0);
|
|
26600
|
+
}
|
|
26601
|
+
const url = URL.createObjectURL(this.fileTest);
|
|
26602
|
+
console.log("url:" + url);
|
|
26603
|
+
const a3 = document.createElement("a");
|
|
26604
|
+
document.body.appendChild(a3);
|
|
26605
|
+
a3.style.display = "none";
|
|
26606
|
+
a3.href = url;
|
|
26607
|
+
a3.download = this.fileTest.name;
|
|
26608
|
+
a3.click();
|
|
26609
|
+
window.URL.revokeObjectURL(url);
|
|
26574
26610
|
}
|
|
26575
26611
|
async download() {
|
|
26576
26612
|
const file = new File(["foo"], "file.txt", {
|
|
26577
26613
|
type: "text/plain"
|
|
26578
26614
|
});
|
|
26615
|
+
this.fileTest = new File(["foo"], "fileTest.txt", {
|
|
26616
|
+
type: "text/plain"
|
|
26617
|
+
});
|
|
26579
26618
|
this.proctoringSession = new ProctoringSession();
|
|
26580
26619
|
this.proctoringSession.addRecording(
|
|
26581
26620
|
{
|
package/index.js
CHANGED
|
@@ -38108,22 +38108,61 @@ Error: ` + error);
|
|
|
38108
38108
|
await this.finish();
|
|
38109
38109
|
console.log("Length:" + this.proctoringSession.recordings.length);
|
|
38110
38110
|
for (let i3 = 0; i3 < this.proctoringSession.recordings.length; i3++) {
|
|
38111
|
+
console.log("baixando " + this.proctoringSession.recordings[i3].device);
|
|
38111
38112
|
this.state = "Stop" /* Stop */;
|
|
38112
38113
|
const file2 = this.proctoringSession.recordings[i3].file;
|
|
38113
|
-
const
|
|
38114
|
-
|
|
38115
|
-
|
|
38116
|
-
|
|
38117
|
-
|
|
38118
|
-
|
|
38119
|
-
|
|
38120
|
-
|
|
38114
|
+
const url22 = URL.createObjectURL(file2);
|
|
38115
|
+
console.log("url2 " + url22);
|
|
38116
|
+
console.log("file2 length " + file2.size);
|
|
38117
|
+
const a4 = document.createElement("a");
|
|
38118
|
+
document.body.appendChild(a4);
|
|
38119
|
+
a4.style.display = "none";
|
|
38120
|
+
a4.href = url22;
|
|
38121
|
+
a4.download = file2.name;
|
|
38122
|
+
a4.click();
|
|
38123
|
+
console.log("click " + this.proctoringSession.recordings[i3].device);
|
|
38124
|
+
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
38125
|
+
setTimeout(function() {
|
|
38126
|
+
window.URL.revokeObjectURL(url22);
|
|
38127
|
+
}, 0);
|
|
38121
38128
|
}
|
|
38129
|
+
for (let i3 = 0; i3 < this.proctoringSession.recordings.length; i3++) {
|
|
38130
|
+
console.log("baixando " + this.proctoringSession.recordings[i3].device);
|
|
38131
|
+
this.state = "Stop" /* Stop */;
|
|
38132
|
+
const currentFile = this.proctoringSession.recordings[i3].file;
|
|
38133
|
+
const file2 = new File([currentFile], currentFile.name);
|
|
38134
|
+
const url22 = URL.createObjectURL(file2);
|
|
38135
|
+
console.log("url2 " + url22);
|
|
38136
|
+
console.log("file2 length " + file2.size);
|
|
38137
|
+
const a4 = document.createElement("a");
|
|
38138
|
+
document.body.appendChild(a4);
|
|
38139
|
+
a4.style.display = "none";
|
|
38140
|
+
a4.href = url22;
|
|
38141
|
+
a4.download = file2.name;
|
|
38142
|
+
a4.click();
|
|
38143
|
+
console.log("click " + this.proctoringSession.recordings[i3].device);
|
|
38144
|
+
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
38145
|
+
setTimeout(function() {
|
|
38146
|
+
window.URL.revokeObjectURL(url22);
|
|
38147
|
+
}, 0);
|
|
38148
|
+
}
|
|
38149
|
+
const url2 = URL.createObjectURL(this.fileTest);
|
|
38150
|
+
console.log("url:" + url2);
|
|
38151
|
+
const a3 = document.createElement("a");
|
|
38152
|
+
document.body.appendChild(a3);
|
|
38153
|
+
a3.style.display = "none";
|
|
38154
|
+
a3.href = url2;
|
|
38155
|
+
a3.download = this.fileTest.name;
|
|
38156
|
+
a3.click();
|
|
38157
|
+
window.URL.revokeObjectURL(url2);
|
|
38122
38158
|
}
|
|
38123
38159
|
async download() {
|
|
38124
38160
|
const file = new File(["foo"], "file.txt", {
|
|
38125
38161
|
type: "text/plain"
|
|
38126
38162
|
});
|
|
38163
|
+
this.fileTest = new File(["foo"], "fileTest.txt", {
|
|
38164
|
+
type: "text/plain"
|
|
38165
|
+
});
|
|
38127
38166
|
this.proctoringSession = new ProctoringSession();
|
|
38128
38167
|
this.proctoringSession.addRecording(
|
|
38129
38168
|
{
|
package/package.json
CHANGED
package/unpkg/easyproctor.min.js
CHANGED
|
@@ -254,5 +254,5 @@ Navigator: ${JSON.stringify(s)}`),this.state="Recording"}catch(i){throw await th
|
|
|
254
254
|
Version: ${D2()}
|
|
255
255
|
Navigator: ${navigator}
|
|
256
256
|
Error: ${i}`),this.state="Stop",i}}async cancel(){(this.state==="Recording"||this.state==="Starting")&&await this.recorder.stopAll(),this.state="Stop"}async finish(t={}){try{if(this.extension.options=t,this.state!=="Recording")throw o0;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),this.state="Stop"}catch(r){throw await this.cancel(),jt.registerFinish(this.proctoringId,!1,`Token: ${this.context.token}
|
|
257
|
-
Error: `+r),this.state="Stop",r}}async verifyMultipleMonitors(t){if(!t.allowMultipleMonitors&&await Go())throw jt.registerError(this.proctoringId,"Multiplas telas detectadas!"),a0}async finishDownload(){await this.finish(),console.log("Length:"+this.proctoringSession.recordings.length);for(let
|
|
257
|
+
Error: `+r),this.state="Stop",r}}async verifyMultipleMonitors(t){if(!t.allowMultipleMonitors&&await Go())throw jt.registerError(this.proctoringId,"Multiplas telas detectadas!"),a0}async finishDownload(){await this.finish(),console.log("Length:"+this.proctoringSession.recordings.length);for(let i=0;i<this.proctoringSession.recordings.length;i++){console.log("baixando "+this.proctoringSession.recordings[i].device),this.state="Stop";let n=this.proctoringSession.recordings[i].file,s=URL.createObjectURL(n);console.log("url2 "+s),console.log("file2 length "+n.size);let a=document.createElement("a");document.body.appendChild(a),a.style.display="none",a.href=s,a.download=n.name,a.click(),console.log("click "+this.proctoringSession.recordings[i].device),console.log("revokeObjectURL "+this.proctoringSession.recordings[i].device),setTimeout(function(){window.URL.revokeObjectURL(s)},0)}for(let i=0;i<this.proctoringSession.recordings.length;i++){console.log("baixando "+this.proctoringSession.recordings[i].device),this.state="Stop";let n=this.proctoringSession.recordings[i].file,s=new File([n],n.name),a=URL.createObjectURL(s);console.log("url2 "+a),console.log("file2 length "+s.size);let m=document.createElement("a");document.body.appendChild(m),m.style.display="none",m.href=a,m.download=s.name,m.click(),console.log("click "+this.proctoringSession.recordings[i].device),console.log("revokeObjectURL "+this.proctoringSession.recordings[i].device),setTimeout(function(){window.URL.revokeObjectURL(a)},0)}let t=URL.createObjectURL(this.fileTest);console.log("url:"+t);let r=document.createElement("a");document.body.appendChild(r),r.style.display="none",r.href=t,r.download=this.fileTest.name,r.click(),window.URL.revokeObjectURL(t)}async download(){let t=new File(["foo"],"file.txt",{type:"text/plain"});this.fileTest=new File(["foo"],"fileTest.txt",{type:"text/plain"}),this.proctoringSession=new Xo,this.proctoringSession.addRecording({device:"teste txt",file:t,origin:"Camera"}),await this.start({cameraId:"default",microphoneId:"default",allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1,captureScreen:!1,proctoringType:"VIDEO",onBufferSizeError:!0,useGeolocation:!0,insights:""},{width:1280,height:720,minWidth:1280,minHeight:720}),setTimeout(()=>{this.finishDownload()},5e3)}async verifyBrowser(){let t=await fm();if(t!=="chrome"&&t!=="firefox")throw jt.registerBrowserNotSupported(this.proctoringId,`Browser n\xE3o suportado:
|
|
258
258
|
Tentativa utilizando o browser ${t}`),zu}async initConfig(t){try{let r=await this.backend.getParamsConfig(this.context);this.paramsConfig={...this.paramsConfig,...r,audioBehaviourParameters:{...this.paramsConfig.audioBehaviourParameters,...r.audioBehaviourParameters},imageBehaviourParameters:{...this.paramsConfig.imageBehaviourParameters,...r.imageBehaviourParameters},videoBehaviourParameters:{...this.paramsConfig.videoBehaviourParameters,...r.videoBehaviourParameters}},t&&(this.geolocation=await mm().then(i=>i).catch(i=>{throw i.message})),ou(this.backend)}catch(r){throw this.proctoringId&&jt.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),r}}async getServerDate(){let t=await this.backend.getServerHour(this.context.token).catch(i=>{jt.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return t?new Date(t.toString()):new Date}async pause(){if(this.state!=="Recording")throw jt.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),o0;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),this.state="Paused"}async resume(){if(this.state!="Paused")throw o0;return await this.verifyBrowser(),await this.verifyMultipleMonitors(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};function N2(e,t="prod"){let r=new N1({type:t,clientId:e.clientId,examId:e.examId,token:e.token,credentials:e.credentials}),i=new K0({type:t,clientId:e.clientId,examId:e.examId,token:e.token,credentials:e.credentials}),n=new oa,s=r.login.bind(r),a=r.start.bind(r),m=r.finish.bind(r),_=r.pause.bind(r),T=r.resume.bind(r),Z=r.setOnFocusCallback.bind(r),G=r.setOnLostFocusCallback.bind(r),fe=r.onChangeDevices.bind(r),Ae=r.setOnBufferSizeErrorCallback.bind(r),ne=r.setOnStopSharingScreenCallback.bind(r),_e=r.onRealtimeAlerts.bind(r),J=i.checkDevices.bind(i),Ue=n.takePicture.bind(n),Ie=r.download.bind(r);return{login:s,start:a,finish:m,onFocus:Z,onLostFocus:G,onChangeDevices:fe,onBufferSizeError:Ae,onRealtimeAlerts:_e,checkDevices:J,capturePhoto:Ue,pause:_,resume:T,enumarateDevices:gi,checkPermissions:jo,checkIfhasMultipleMonitors:Go,onStopSharingScreen:ne,download:Ie}}typeof window<"u"&&(window.useProctoring=N2);})();
|