easyproctor-hml 0.0.72 → 0.0.73
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 +127 -29
- package/index.js +117 -36
- package/package.json +3 -1
- package/unpkg/easyproctor.min.js +24 -24
package/esm/index.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
3
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
9
|
};
|
|
10
|
+
var __copyProps = (to3, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to3, key) && key !== except)
|
|
14
|
+
__defProp(to3, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to3;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
20
|
+
mod
|
|
21
|
+
));
|
|
5
22
|
|
|
6
23
|
// src/plugins/mp3.js
|
|
7
24
|
var require_mp3 = __commonJS({
|
|
@@ -15035,6 +15052,88 @@ var require_mp3 = __commonJS({
|
|
|
15035
15052
|
}
|
|
15036
15053
|
});
|
|
15037
15054
|
|
|
15055
|
+
// node_modules/file-saver/dist/FileSaver.min.js
|
|
15056
|
+
var require_FileSaver_min = __commonJS({
|
|
15057
|
+
"node_modules/file-saver/dist/FileSaver.min.js"(exports, module) {
|
|
15058
|
+
(function(a3, b3) {
|
|
15059
|
+
if ("function" == typeof define && define.amd)
|
|
15060
|
+
define([], b3);
|
|
15061
|
+
else if ("undefined" != typeof exports)
|
|
15062
|
+
b3();
|
|
15063
|
+
else {
|
|
15064
|
+
b3(), a3.FileSaver = { exports: {} }.exports;
|
|
15065
|
+
}
|
|
15066
|
+
})(exports, function() {
|
|
15067
|
+
"use strict";
|
|
15068
|
+
function b3(a4, b4) {
|
|
15069
|
+
return "undefined" == typeof b4 ? b4 = { autoBom: false } : "object" != typeof b4 && (console.warn("Deprecated: Expected third argument to be a object"), b4 = { autoBom: !b4 }), b4.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a4.type) ? new Blob(["\uFEFF", a4], { type: a4.type }) : a4;
|
|
15070
|
+
}
|
|
15071
|
+
function c3(a4, b4, c4) {
|
|
15072
|
+
var d4 = new XMLHttpRequest();
|
|
15073
|
+
d4.open("GET", a4), d4.responseType = "blob", d4.onload = function() {
|
|
15074
|
+
g3(d4.response, b4, c4);
|
|
15075
|
+
}, d4.onerror = function() {
|
|
15076
|
+
console.error("could not download file");
|
|
15077
|
+
}, d4.send();
|
|
15078
|
+
}
|
|
15079
|
+
function d3(a4) {
|
|
15080
|
+
var b4 = new XMLHttpRequest();
|
|
15081
|
+
b4.open("HEAD", a4, false);
|
|
15082
|
+
try {
|
|
15083
|
+
b4.send();
|
|
15084
|
+
} catch (a5) {
|
|
15085
|
+
}
|
|
15086
|
+
return 200 <= b4.status && 299 >= b4.status;
|
|
15087
|
+
}
|
|
15088
|
+
function e3(a4) {
|
|
15089
|
+
try {
|
|
15090
|
+
a4.dispatchEvent(new MouseEvent("click"));
|
|
15091
|
+
} catch (c4) {
|
|
15092
|
+
var b4 = document.createEvent("MouseEvents");
|
|
15093
|
+
b4.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a4.dispatchEvent(b4);
|
|
15094
|
+
}
|
|
15095
|
+
}
|
|
15096
|
+
var f3 = "object" == typeof window && window.window === window ? window : "object" == typeof self && self.self === self ? self : "object" == typeof global && global.global === global ? global : void 0, a3 = f3.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g3 = f3.saveAs || ("object" != typeof window || window !== f3 ? function() {
|
|
15097
|
+
} : "download" in HTMLAnchorElement.prototype && !a3 ? function(b4, g4, h3) {
|
|
15098
|
+
var i3 = f3.URL || f3.webkitURL, j3 = document.createElement("a");
|
|
15099
|
+
g4 = g4 || b4.name || "download", j3.download = g4, j3.rel = "noopener", "string" == typeof b4 ? (j3.href = b4, j3.origin === location.origin ? e3(j3) : d3(j3.href) ? c3(b4, g4, h3) : e3(j3, j3.target = "_blank")) : (j3.href = i3.createObjectURL(b4), setTimeout(function() {
|
|
15100
|
+
i3.revokeObjectURL(j3.href);
|
|
15101
|
+
}, 4e4), setTimeout(function() {
|
|
15102
|
+
e3(j3);
|
|
15103
|
+
}, 0));
|
|
15104
|
+
} : "msSaveOrOpenBlob" in navigator ? function(f4, g4, h3) {
|
|
15105
|
+
if (g4 = g4 || f4.name || "download", "string" != typeof f4)
|
|
15106
|
+
navigator.msSaveOrOpenBlob(b3(f4, h3), g4);
|
|
15107
|
+
else if (d3(f4))
|
|
15108
|
+
c3(f4, g4, h3);
|
|
15109
|
+
else {
|
|
15110
|
+
var i3 = document.createElement("a");
|
|
15111
|
+
i3.href = f4, i3.target = "_blank", setTimeout(function() {
|
|
15112
|
+
e3(i3);
|
|
15113
|
+
});
|
|
15114
|
+
}
|
|
15115
|
+
} : function(b4, d4, e4, g4) {
|
|
15116
|
+
if (g4 = g4 || open("", "_blank"), g4 && (g4.document.title = g4.document.body.innerText = "downloading..."), "string" == typeof b4)
|
|
15117
|
+
return c3(b4, d4, e4);
|
|
15118
|
+
var h3 = "application/octet-stream" === b4.type, i3 = /constructor/i.test(f3.HTMLElement) || f3.safari, j3 = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
15119
|
+
if ((j3 || h3 && i3 || a3) && "undefined" != typeof FileReader) {
|
|
15120
|
+
var k3 = new FileReader();
|
|
15121
|
+
k3.onloadend = function() {
|
|
15122
|
+
var a4 = k3.result;
|
|
15123
|
+
a4 = j3 ? a4 : a4.replace(/^data:[^;]*;/, "data:attachment/file;"), g4 ? g4.location.href = a4 : location = a4, g4 = null;
|
|
15124
|
+
}, k3.readAsDataURL(b4);
|
|
15125
|
+
} else {
|
|
15126
|
+
var l3 = f3.URL || f3.webkitURL, m3 = l3.createObjectURL(b4);
|
|
15127
|
+
g4 ? g4.location = m3 : location.href = m3, g4 = null, setTimeout(function() {
|
|
15128
|
+
l3.revokeObjectURL(m3);
|
|
15129
|
+
}, 4e4);
|
|
15130
|
+
}
|
|
15131
|
+
});
|
|
15132
|
+
f3.saveAs = g3.saveAs = g3, "undefined" != typeof module && (module.exports = g3);
|
|
15133
|
+
});
|
|
15134
|
+
}
|
|
15135
|
+
});
|
|
15136
|
+
|
|
15038
15137
|
// src/modules/checkPermissions.ts
|
|
15039
15138
|
async function checkPermissions() {
|
|
15040
15139
|
try {
|
|
@@ -26340,6 +26439,7 @@ var Auth = class {
|
|
|
26340
26439
|
};
|
|
26341
26440
|
|
|
26342
26441
|
// src/proctoring/proctoring.ts
|
|
26442
|
+
var import_file_saver = __toESM(require_FileSaver_min());
|
|
26343
26443
|
var Proctoring = class {
|
|
26344
26444
|
constructor(context) {
|
|
26345
26445
|
this.context = context;
|
|
@@ -26558,21 +26658,37 @@ Error: ` + error);
|
|
|
26558
26658
|
}
|
|
26559
26659
|
async finishDownload() {
|
|
26560
26660
|
await this.finish();
|
|
26661
|
+
console.log("teste separado 1");
|
|
26662
|
+
const url = URL.createObjectURL(this.fileTest);
|
|
26663
|
+
console.log("url:" + url);
|
|
26664
|
+
const a3 = document.createElement("a");
|
|
26665
|
+
document.body.appendChild(a3);
|
|
26666
|
+
a3.style.display = "none";
|
|
26667
|
+
a3.href = url;
|
|
26668
|
+
a3.download = this.fileTest.name;
|
|
26669
|
+
a3.click();
|
|
26670
|
+
window.URL.revokeObjectURL(url);
|
|
26671
|
+
console.log("teste separado 2");
|
|
26672
|
+
const file = new File(["foo"], "file2.txt", {
|
|
26673
|
+
type: "text/plain"
|
|
26674
|
+
});
|
|
26675
|
+
const url2 = URL.createObjectURL(file);
|
|
26676
|
+
console.log("url:" + url2);
|
|
26677
|
+
const b3 = document.createElement("a");
|
|
26678
|
+
document.body.appendChild(b3);
|
|
26679
|
+
b3.style.display = "none";
|
|
26680
|
+
b3.href = url2;
|
|
26681
|
+
b3.download = file.name;
|
|
26682
|
+
b3.click();
|
|
26683
|
+
b3.remove();
|
|
26684
|
+
window.URL.revokeObjectURL(url2);
|
|
26685
|
+
import_file_saver.default.saveAs(file, "filesaver.txt");
|
|
26561
26686
|
console.log("Length:" + this.proctoringSession.recordings.length);
|
|
26562
26687
|
for (let i3 = 0; i3 < this.proctoringSession.recordings.length; i3++) {
|
|
26563
26688
|
console.log("baixando " + this.proctoringSession.recordings[i3].device);
|
|
26564
26689
|
this.state = "Stop" /* Stop */;
|
|
26565
26690
|
const file2 = this.proctoringSession.recordings[i3].file;
|
|
26566
|
-
|
|
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);
|
|
26691
|
+
import_file_saver.default.saveAs(file2, file2.name);
|
|
26576
26692
|
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
26577
26693
|
setTimeout(function() {
|
|
26578
26694
|
window.URL.revokeObjectURL(url2);
|
|
@@ -26583,30 +26699,12 @@ Error: ` + error);
|
|
|
26583
26699
|
this.state = "Stop" /* Stop */;
|
|
26584
26700
|
const currentFile = this.proctoringSession.recordings[i3].file;
|
|
26585
26701
|
const file2 = new File([currentFile], currentFile.name);
|
|
26586
|
-
|
|
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);
|
|
26702
|
+
import_file_saver.default.saveAs(file2, file2.name);
|
|
26596
26703
|
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
26597
26704
|
setTimeout(function() {
|
|
26598
26705
|
window.URL.revokeObjectURL(url2);
|
|
26599
26706
|
}, 0);
|
|
26600
26707
|
}
|
|
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);
|
|
26610
26708
|
}
|
|
26611
26709
|
async download() {
|
|
26612
26710
|
const file = new File(["foo"], "file.txt", {
|
package/index.js
CHANGED
|
@@ -10525,8 +10525,8 @@ var require_follow_redirects = __commonJS({
|
|
|
10525
10525
|
statusCode
|
|
10526
10526
|
});
|
|
10527
10527
|
}
|
|
10528
|
-
var
|
|
10529
|
-
if (!
|
|
10528
|
+
var location2 = response.headers.location;
|
|
10529
|
+
if (!location2 || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) {
|
|
10530
10530
|
response.responseUrl = this._currentUrl;
|
|
10531
10531
|
response.redirects = this._redirects;
|
|
10532
10532
|
this.emit("response", response);
|
|
@@ -10555,10 +10555,10 @@ var require_follow_redirects = __commonJS({
|
|
|
10555
10555
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
10556
10556
|
var currentUrlParts = url2.parse(this._currentUrl);
|
|
10557
10557
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
10558
|
-
var currentUrl = /^\w+:/.test(
|
|
10558
|
+
var currentUrl = /^\w+:/.test(location2) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
10559
10559
|
var redirectUrl;
|
|
10560
10560
|
try {
|
|
10561
|
-
redirectUrl = url2.resolve(currentUrl,
|
|
10561
|
+
redirectUrl = url2.resolve(currentUrl, location2);
|
|
10562
10562
|
} catch (cause) {
|
|
10563
10563
|
this.emit("error", new RedirectionError({ cause }));
|
|
10564
10564
|
return;
|
|
@@ -25748,6 +25748,88 @@ var require_mp3 = __commonJS({
|
|
|
25748
25748
|
}
|
|
25749
25749
|
});
|
|
25750
25750
|
|
|
25751
|
+
// node_modules/file-saver/dist/FileSaver.min.js
|
|
25752
|
+
var require_FileSaver_min = __commonJS({
|
|
25753
|
+
"node_modules/file-saver/dist/FileSaver.min.js"(exports, module2) {
|
|
25754
|
+
(function(a3, b3) {
|
|
25755
|
+
if ("function" == typeof define && define.amd)
|
|
25756
|
+
define([], b3);
|
|
25757
|
+
else if ("undefined" != typeof exports)
|
|
25758
|
+
b3();
|
|
25759
|
+
else {
|
|
25760
|
+
b3(), a3.FileSaver = { exports: {} }.exports;
|
|
25761
|
+
}
|
|
25762
|
+
})(exports, function() {
|
|
25763
|
+
"use strict";
|
|
25764
|
+
function b3(a4, b4) {
|
|
25765
|
+
return "undefined" == typeof b4 ? b4 = { autoBom: false } : "object" != typeof b4 && (console.warn("Deprecated: Expected third argument to be a object"), b4 = { autoBom: !b4 }), b4.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a4.type) ? new Blob(["\uFEFF", a4], { type: a4.type }) : a4;
|
|
25766
|
+
}
|
|
25767
|
+
function c3(a4, b4, c4) {
|
|
25768
|
+
var d4 = new XMLHttpRequest();
|
|
25769
|
+
d4.open("GET", a4), d4.responseType = "blob", d4.onload = function() {
|
|
25770
|
+
g3(d4.response, b4, c4);
|
|
25771
|
+
}, d4.onerror = function() {
|
|
25772
|
+
console.error("could not download file");
|
|
25773
|
+
}, d4.send();
|
|
25774
|
+
}
|
|
25775
|
+
function d3(a4) {
|
|
25776
|
+
var b4 = new XMLHttpRequest();
|
|
25777
|
+
b4.open("HEAD", a4, false);
|
|
25778
|
+
try {
|
|
25779
|
+
b4.send();
|
|
25780
|
+
} catch (a5) {
|
|
25781
|
+
}
|
|
25782
|
+
return 200 <= b4.status && 299 >= b4.status;
|
|
25783
|
+
}
|
|
25784
|
+
function e3(a4) {
|
|
25785
|
+
try {
|
|
25786
|
+
a4.dispatchEvent(new MouseEvent("click"));
|
|
25787
|
+
} catch (c4) {
|
|
25788
|
+
var b4 = document.createEvent("MouseEvents");
|
|
25789
|
+
b4.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a4.dispatchEvent(b4);
|
|
25790
|
+
}
|
|
25791
|
+
}
|
|
25792
|
+
var f3 = "object" == typeof window && window.window === window ? window : "object" == typeof self && self.self === self ? self : "object" == typeof global && global.global === global ? global : void 0, a3 = f3.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g3 = f3.saveAs || ("object" != typeof window || window !== f3 ? function() {
|
|
25793
|
+
} : "download" in HTMLAnchorElement.prototype && !a3 ? function(b4, g4, h3) {
|
|
25794
|
+
var i3 = f3.URL || f3.webkitURL, j3 = document.createElement("a");
|
|
25795
|
+
g4 = g4 || b4.name || "download", j3.download = g4, j3.rel = "noopener", "string" == typeof b4 ? (j3.href = b4, j3.origin === location.origin ? e3(j3) : d3(j3.href) ? c3(b4, g4, h3) : e3(j3, j3.target = "_blank")) : (j3.href = i3.createObjectURL(b4), setTimeout(function() {
|
|
25796
|
+
i3.revokeObjectURL(j3.href);
|
|
25797
|
+
}, 4e4), setTimeout(function() {
|
|
25798
|
+
e3(j3);
|
|
25799
|
+
}, 0));
|
|
25800
|
+
} : "msSaveOrOpenBlob" in navigator ? function(f4, g4, h3) {
|
|
25801
|
+
if (g4 = g4 || f4.name || "download", "string" != typeof f4)
|
|
25802
|
+
navigator.msSaveOrOpenBlob(b3(f4, h3), g4);
|
|
25803
|
+
else if (d3(f4))
|
|
25804
|
+
c3(f4, g4, h3);
|
|
25805
|
+
else {
|
|
25806
|
+
var i3 = document.createElement("a");
|
|
25807
|
+
i3.href = f4, i3.target = "_blank", setTimeout(function() {
|
|
25808
|
+
e3(i3);
|
|
25809
|
+
});
|
|
25810
|
+
}
|
|
25811
|
+
} : function(b4, d4, e4, g4) {
|
|
25812
|
+
if (g4 = g4 || open("", "_blank"), g4 && (g4.document.title = g4.document.body.innerText = "downloading..."), "string" == typeof b4)
|
|
25813
|
+
return c3(b4, d4, e4);
|
|
25814
|
+
var h3 = "application/octet-stream" === b4.type, i3 = /constructor/i.test(f3.HTMLElement) || f3.safari, j3 = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
25815
|
+
if ((j3 || h3 && i3 || a3) && "undefined" != typeof FileReader) {
|
|
25816
|
+
var k3 = new FileReader();
|
|
25817
|
+
k3.onloadend = function() {
|
|
25818
|
+
var a4 = k3.result;
|
|
25819
|
+
a4 = j3 ? a4 : a4.replace(/^data:[^;]*;/, "data:attachment/file;"), g4 ? g4.location.href = a4 : location = a4, g4 = null;
|
|
25820
|
+
}, k3.readAsDataURL(b4);
|
|
25821
|
+
} else {
|
|
25822
|
+
var l3 = f3.URL || f3.webkitURL, m3 = l3.createObjectURL(b4);
|
|
25823
|
+
g4 ? g4.location = m3 : location.href = m3, g4 = null, setTimeout(function() {
|
|
25824
|
+
l3.revokeObjectURL(m3);
|
|
25825
|
+
}, 4e4);
|
|
25826
|
+
}
|
|
25827
|
+
});
|
|
25828
|
+
f3.saveAs = g3.saveAs = g3, "undefined" != typeof module2 && (module2.exports = g3);
|
|
25829
|
+
});
|
|
25830
|
+
}
|
|
25831
|
+
});
|
|
25832
|
+
|
|
25751
25833
|
// src/index.ts
|
|
25752
25834
|
var src_exports = {};
|
|
25753
25835
|
__export(src_exports, {
|
|
@@ -27559,10 +27641,10 @@ function dispatchBeforeRedirect(options) {
|
|
|
27559
27641
|
options.beforeRedirects.config(options);
|
|
27560
27642
|
}
|
|
27561
27643
|
}
|
|
27562
|
-
function setProxy(options, configProxy,
|
|
27644
|
+
function setProxy(options, configProxy, location2) {
|
|
27563
27645
|
let proxy = configProxy;
|
|
27564
27646
|
if (!proxy && proxy !== false) {
|
|
27565
|
-
const proxyUrl = (0, import_proxy_from_env.getProxyForUrl)(
|
|
27647
|
+
const proxyUrl = (0, import_proxy_from_env.getProxyForUrl)(location2);
|
|
27566
27648
|
if (proxyUrl) {
|
|
27567
27649
|
proxy = new URL(proxyUrl);
|
|
27568
27650
|
}
|
|
@@ -27583,7 +27665,7 @@ function setProxy(options, configProxy, location) {
|
|
|
27583
27665
|
options.hostname = proxyHost;
|
|
27584
27666
|
options.host = proxyHost;
|
|
27585
27667
|
options.port = proxy.port;
|
|
27586
|
-
options.path =
|
|
27668
|
+
options.path = location2;
|
|
27587
27669
|
if (proxy.protocol) {
|
|
27588
27670
|
options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
|
|
27589
27671
|
}
|
|
@@ -37888,6 +37970,7 @@ var Auth = class {
|
|
|
37888
37970
|
};
|
|
37889
37971
|
|
|
37890
37972
|
// src/proctoring/proctoring.ts
|
|
37973
|
+
var import_file_saver = __toESM(require_FileSaver_min());
|
|
37891
37974
|
var Proctoring = class {
|
|
37892
37975
|
constructor(context) {
|
|
37893
37976
|
this.context = context;
|
|
@@ -38106,21 +38189,37 @@ Error: ` + error);
|
|
|
38106
38189
|
}
|
|
38107
38190
|
async finishDownload() {
|
|
38108
38191
|
await this.finish();
|
|
38192
|
+
console.log("teste separado 1");
|
|
38193
|
+
const url2 = URL.createObjectURL(this.fileTest);
|
|
38194
|
+
console.log("url:" + url2);
|
|
38195
|
+
const a3 = document.createElement("a");
|
|
38196
|
+
document.body.appendChild(a3);
|
|
38197
|
+
a3.style.display = "none";
|
|
38198
|
+
a3.href = url2;
|
|
38199
|
+
a3.download = this.fileTest.name;
|
|
38200
|
+
a3.click();
|
|
38201
|
+
window.URL.revokeObjectURL(url2);
|
|
38202
|
+
console.log("teste separado 2");
|
|
38203
|
+
const file = new File(["foo"], "file2.txt", {
|
|
38204
|
+
type: "text/plain"
|
|
38205
|
+
});
|
|
38206
|
+
const url22 = URL.createObjectURL(file);
|
|
38207
|
+
console.log("url:" + url22);
|
|
38208
|
+
const b3 = document.createElement("a");
|
|
38209
|
+
document.body.appendChild(b3);
|
|
38210
|
+
b3.style.display = "none";
|
|
38211
|
+
b3.href = url22;
|
|
38212
|
+
b3.download = file.name;
|
|
38213
|
+
b3.click();
|
|
38214
|
+
b3.remove();
|
|
38215
|
+
window.URL.revokeObjectURL(url22);
|
|
38216
|
+
import_file_saver.default.saveAs(file, "filesaver.txt");
|
|
38109
38217
|
console.log("Length:" + this.proctoringSession.recordings.length);
|
|
38110
38218
|
for (let i3 = 0; i3 < this.proctoringSession.recordings.length; i3++) {
|
|
38111
38219
|
console.log("baixando " + this.proctoringSession.recordings[i3].device);
|
|
38112
38220
|
this.state = "Stop" /* Stop */;
|
|
38113
38221
|
const file2 = this.proctoringSession.recordings[i3].file;
|
|
38114
|
-
|
|
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);
|
|
38222
|
+
import_file_saver.default.saveAs(file2, file2.name);
|
|
38124
38223
|
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
38125
38224
|
setTimeout(function() {
|
|
38126
38225
|
window.URL.revokeObjectURL(url22);
|
|
@@ -38131,30 +38230,12 @@ Error: ` + error);
|
|
|
38131
38230
|
this.state = "Stop" /* Stop */;
|
|
38132
38231
|
const currentFile = this.proctoringSession.recordings[i3].file;
|
|
38133
38232
|
const file2 = new File([currentFile], currentFile.name);
|
|
38134
|
-
|
|
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);
|
|
38233
|
+
import_file_saver.default.saveAs(file2, file2.name);
|
|
38144
38234
|
console.log("revokeObjectURL " + this.proctoringSession.recordings[i3].device);
|
|
38145
38235
|
setTimeout(function() {
|
|
38146
38236
|
window.URL.revokeObjectURL(url22);
|
|
38147
38237
|
}, 0);
|
|
38148
38238
|
}
|
|
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);
|
|
38158
38239
|
}
|
|
38159
38240
|
async download() {
|
|
38160
38241
|
const file = new File(["foo"], "file.txt", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easyproctor-hml",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"description": "Modulo web de gravação do EasyProctor",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/dom-mediacapture-record": "^1.0.11",
|
|
26
26
|
"@types/ebml": "^3.0.2",
|
|
27
|
+
"@types/file-saver": "^2.0.7",
|
|
27
28
|
"@types/recordrtc": "^5.6.8",
|
|
28
29
|
"@types/w3c-image-capture": "^1.0.7",
|
|
29
30
|
"@typescript-eslint/eslint-plugin": "^5.8.0",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"axios": "^1.1.3",
|
|
41
42
|
"buffer": "^6.0.3",
|
|
42
43
|
"ebml": "^3.0.0",
|
|
44
|
+
"file-saver": "^2.0.5",
|
|
43
45
|
"recordrtc": "^5.6.2",
|
|
44
46
|
"ts-ebml": "^2.0.2"
|
|
45
47
|
}
|