easyproctor-hml 2.5.20 → 2.5.22

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/README.md CHANGED
@@ -263,17 +263,46 @@ const {
263
263
  token: "...",
264
264
  });
265
265
  ```
266
- ## Release Note V 2.4.0
267
- - Compatibilidade com dispositivos móveis
268
266
 
269
- ## Release Note V 2.3.3
270
- - Correção do reset no startSession
267
+ ## Release Note V 2.5.4
268
+ - Fix: Correção sobre as imagens do realtime
269
+
270
+ ## Release Note V 2.5.4
271
+ - Novos alertas de tela (Clipboard, SplitScreen)
272
+ - Ajustes na detecção de foco da tela
273
+ - Melhorias na analise biométrica
274
+ - Melhorias na analise do uso de dispositivos
275
+ - Correção do uso de câmera externa no ambiente de produção
276
+
277
+ ## Release Note V 2.5.3
278
+ - Fix: Resolução do video
279
+ - Melhorias no proctoring do tipo REALTIME
280
+
281
+ ## Release Note V 2.5.2
282
+ - Alteração do nome do callback 'onFinish' para 'onResultAvailable'
283
+ - Melhorias no proctoring do tipo REALTIME
284
+
285
+ ## Release Note V 2.5.1
286
+ - Novos atributos no callback de 'onFinish'
287
+ - scoreThreshold: limiar de aprovação da sessão de proctoring
288
+ - justification: em caso de reprovação, esse campo traz o resumo das irregularidades
289
+
290
+ ## Release Note V 2.5.0
291
+ - Callback de 'onFinish' no hook de finish que permite o acesso ao resultado da auditoria de forma imediata
292
+ - Melhorias no proctoring em tempo real
293
+ - Melhorias no monitoramento ativo durante o exame
294
+ - Novos tipos de alertas do onRealtimeAlerts:
295
+ - position_detection_on_stream:
296
+ - wrong_face_size_detected: Face muito perto da câmera, afaste-se um pouco mais
297
+ - wrong_face_position_edge_detected: Face muito próxima da borda, mova-se para o centro da tela
298
+ - wrong_face_position_move_right_detected: Face não centralizada, mova-se para a direita
299
+ - wrong_face_position_move_top_detected: Face não centralizada, mova-se para cima
300
+ - wrong_face_position_move_left_detected: Face não centralizada, mova-se para a esquerda
301
+ - wrong_face_position_move_bottom_detected: Face não centralizada, mova-se para baixo
271
302
 
272
- ## Release Note V 2.3.2
273
- - Melhorias no fluxo da câmera externa (reset e goToExternalCameraPositionStep)
274
303
 
275
304
  ## Release Note V 2.4.0
276
- - Compatibilidade com dispositivos móveis implementada
305
+ - Compatibilidade com dispositivos móveis
277
306
 
278
307
  ## Release Note V 2.3.3
279
308
  - Correção do reset no startSession
package/esm/index.js CHANGED
@@ -12167,7 +12167,10 @@ function validatePartialVideoOptions(options) {
12167
12167
  width: options.width,
12168
12168
  height: options.height,
12169
12169
  minWidth: options.minWidth,
12170
- minHeight: options.minHeight
12170
+ minHeight: options.minHeight,
12171
+ timeSlice: options.timeSlice,
12172
+ videoBitsPerSecond: options.videoBitsPerSecond,
12173
+ mimeType: options.mimeType
12171
12174
  };
12172
12175
  } else {
12173
12176
  return { width: 640, height: 480 };
@@ -12254,7 +12257,7 @@ var proctoringId;
12254
12257
  function setRecorderProctoringId(id) {
12255
12258
  proctoringId = id;
12256
12259
  }
12257
- function recorder(stream, buffer, onBufferSizeError = false, onBufferSizeErrorCallback, audio = false) {
12260
+ function recorder(stream, buffer, videoOptions, onBufferSizeError = false, onBufferSizeErrorCallback, audio = false) {
12258
12261
  let resolvePromise;
12259
12262
  let stopped = false;
12260
12263
  let onBufferSizeInterval;
@@ -12264,7 +12267,7 @@ function recorder(stream, buffer, onBufferSizeError = false, onBufferSizeErrorCa
12264
12267
  let recorderOptions = {
12265
12268
  // eslint-disable-next-line no-useless-escape
12266
12269
  mimeType: "video/webm",
12267
- videoBitsPerSecond: 128e3,
12270
+ videoBitsPerSecond: (videoOptions == null ? void 0 : videoOptions.videoBitsPerSecond) || 128e3,
12268
12271
  audioBitsPerSecond: 64 * 1e3
12269
12272
  };
12270
12273
  if (MediaRecorder.isTypeSupported("video/webm;codecs=vp9")) {
@@ -12274,15 +12277,25 @@ function recorder(stream, buffer, onBufferSizeError = false, onBufferSizeErrorCa
12274
12277
  "vp9 codec not supported. Using default mimeType without vp9."
12275
12278
  );
12276
12279
  }
12280
+ if (videoOptions == null ? void 0 : videoOptions.mimeType) {
12281
+ recorderOptions.mimeType = videoOptions == null ? void 0 : videoOptions.mimeType;
12282
+ }
12277
12283
  if (audio) {
12278
12284
  recorderOptions = {
12279
12285
  mimeType: "audio/webm",
12280
12286
  audioBitsPerSecond: 64 * 1e3
12281
12287
  };
12282
12288
  }
12289
+ console.log("recorderOptions bitsPerSecond", recorderOptions.bitsPerSecond);
12283
12290
  const mediaRecorder = new MediaRecorder(stream, recorderOptions);
12284
12291
  mediaRecorder.ondataavailable = (e3) => {
12285
12292
  bufferSize = bufferSize + e3.data.size;
12293
+ console.log("video tracks length > 0", stream.getVideoTracks().length > 0);
12294
+ if (stream.getVideoTracks().length > 0) {
12295
+ const videoTrack = stream.getVideoTracks()[0];
12296
+ console.log(videoTrack.readyState);
12297
+ console.log(videoTrack.enabled);
12298
+ }
12286
12299
  if (e3.data.size > 0) {
12287
12300
  buffer.push(e3.data);
12288
12301
  }
@@ -12310,14 +12323,10 @@ function recorder(stream, buffer, onBufferSizeError = false, onBufferSizeErrorCa
12310
12323
  function startRecording() {
12311
12324
  return new Promise((resolve) => {
12312
12325
  resolvePromise = resolve;
12313
- mediaRecorder.start();
12326
+ console.log("startRecording", videoOptions == null ? void 0 : videoOptions.timeSlice);
12327
+ mediaRecorder.start((videoOptions == null ? void 0 : videoOptions.timeSlice) || 1e4);
12314
12328
  bufferSize = 0;
12315
12329
  stopped = false;
12316
- if (onBufferSizeError) {
12317
- onBufferSizeInterval = setInterval(async () => {
12318
- await mediaRecorder.requestData();
12319
- }, 3e4);
12320
- }
12321
12330
  });
12322
12331
  }
12323
12332
  function stopRecording() {
@@ -12777,13 +12786,21 @@ var CameraRecorder = class {
12777
12786
  }
12778
12787
  }
12779
12788
  configImageCapture() {
12789
+ var _a2;
12780
12790
  this.video = document.createElement("video");
12781
12791
  this.canvas = document.createElement("canvas");
12782
12792
  this.video.srcObject = this.cameraStream;
12783
12793
  this.video.play();
12784
12794
  this.video.muted = true;
12785
- this.canvas.width = this.videoOptions.width;
12786
- this.canvas.height = this.videoOptions.height;
12795
+ const isPortrait = (_a2 = screen.orientation) == null ? void 0 : _a2.type.includes("portrait");
12796
+ if (isPortrait && isMobileDevice()) {
12797
+ console.log("configurando canvas em portrait");
12798
+ this.canvas.width = this.videoOptions.height / 2;
12799
+ this.canvas.height = this.videoOptions.width / 2;
12800
+ } else {
12801
+ this.canvas.width = this.videoOptions.width / 2;
12802
+ this.canvas.height = this.videoOptions.height / 2;
12803
+ }
12787
12804
  }
12788
12805
  async bufferError(e3) {
12789
12806
  var _a2, _b;
@@ -12840,6 +12857,7 @@ var CameraRecorder = class {
12840
12857
  this.cameraStream,
12841
12858
  // streamToRecord,
12842
12859
  this.blobs,
12860
+ this.videoOptions,
12843
12861
  this.options.onBufferSizeError,
12844
12862
  (e3) => this.bufferError(e3),
12845
12863
  false
@@ -12991,7 +13009,6 @@ Setting: ${JSON.stringify(settings, null, 2)}`
12991
13009
  const packSize = (_a2 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _a2.realtimePackageSize;
12992
13010
  this.imageCount = 0;
12993
13011
  this.imageInterval = setInterval(async () => {
12994
- console.log("capturando frame " + this.imageCount);
12995
13012
  this.canvas.getContext("2d").drawImage(this.video, 0, 0, this.canvas.width, this.canvas.height);
12996
13013
  const image_data_url = this.canvas.toDataURL("image/jpeg");
12997
13014
  if (this.proctoringId == void 0) return;
@@ -13123,45 +13140,6 @@ Setting: ${JSON.stringify(settings, null, 2)}`
13123
13140
  }
13124
13141
  this.noiseWait++;
13125
13142
  }
13126
- /**
13127
- * Cria um stream processado onde os frames são rotacionados via Canvas.
13128
- * Isso corrige o problema de gravação deitada em iOS/Mobile.
13129
- */
13130
- createRotatedStream(originalStream) {
13131
- this.internalClonedStream = originalStream.clone();
13132
- const video = document.createElement("video");
13133
- video.srcObject = this.internalClonedStream;
13134
- video.muted = true;
13135
- video.play();
13136
- const canvas = document.createElement("canvas");
13137
- const ctx = canvas.getContext("2d");
13138
- const track = originalStream.getVideoTracks()[0];
13139
- const settings = track.getSettings();
13140
- const width = settings.width || 640;
13141
- const height = settings.height || 480;
13142
- canvas.width = height;
13143
- canvas.height = width;
13144
- const draw = () => {
13145
- if (video.paused || video.ended) return;
13146
- if (!this.isCanvasLoopActive) return;
13147
- if (ctx) {
13148
- ctx.clearRect(0, 0, canvas.width, canvas.height);
13149
- ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
13150
- }
13151
- if (this.isCanvasLoopActive) {
13152
- this.animationFrameId = requestAnimationFrame(draw);
13153
- }
13154
- };
13155
- video.onplaying = () => {
13156
- this.isCanvasLoopActive = true;
13157
- draw();
13158
- };
13159
- const canvasStream = canvas.captureStream(30);
13160
- originalStream.getAudioTracks().forEach((track2) => {
13161
- canvasStream.addTrack(track2);
13162
- });
13163
- return canvasStream;
13164
- }
13165
13143
  };
13166
13144
 
13167
13145
  // src/new-flow/checkers/DeviceCheckerUI.ts
@@ -14558,9 +14536,7 @@ var CapturePhoto = class {
14558
14536
  );
14559
14537
  await this.cameraRecorder.startRecording();
14560
14538
  cameraContainer.srcObject = this.cameraRecorder.cameraStream;
14561
- cameraContainer.play().catch((e3) => {
14562
- console.warn("Autoplay bloqueado ou erro ao iniciar v\xEDdeo:", e3);
14563
- });
14539
+ cameraContainer.play();
14564
14540
  }
14565
14541
  shot() {
14566
14542
  const cameraContainer = document.querySelector("#cameraStream");
@@ -14653,9 +14629,6 @@ var CapturePhoto = class {
14653
14629
  const video = document.createElement("video");
14654
14630
  video.setAttribute("id", "cameraStream");
14655
14631
  video.muted = true;
14656
- video.setAttribute("playsinline", "true");
14657
- video.setAttribute("webkit-playsinline", "true");
14658
- video.autoplay = true;
14659
14632
  divCamera.style.position = "fixed";
14660
14633
  divCamera.style.top = "0";
14661
14634
  divCamera.style.left = "0";
@@ -14842,8 +14815,8 @@ var CapturePhoto = class {
14842
14815
  }
14843
14816
  };
14844
14817
 
14845
- // src/extension/extensionEasyProctor.ts
14846
- var ExtensionEasyProctor = class {
14818
+ // src/extension/extension.ts
14819
+ var Extension = class {
14847
14820
  constructor() {
14848
14821
  this.hasExtension = false;
14849
14822
  this.tryes = 0;
@@ -14888,89 +14861,6 @@ var ExtensionEasyProctor = class {
14888
14861
  }
14889
14862
  };
14890
14863
 
14891
- // src/extension/extensionEasyCatcher.ts
14892
- var ExtensionEasyCatcher = class {
14893
- constructor(options) {
14894
- this.hasExtension = false;
14895
- this.tryes = 0;
14896
- this.responseStart = false;
14897
- this.options = options || {};
14898
- }
14899
- /**
14900
- * Verifica se a extensão está instalada e ativa.
14901
- * Retorna o número da versão se encontrada, ou lança erro após timeout.
14902
- */
14903
- checkExtensionInstalled(timeoutMs = 2e3) {
14904
- return new Promise((resolve, reject) => {
14905
- let handled = false;
14906
- const handler = (event) => {
14907
- if (event.source === window && event.data.sender === "easyproctor-extension" && event.data.message_name === "version") {
14908
- handled = true;
14909
- window.removeEventListener("message", handler);
14910
- resolve(event.data.message);
14911
- }
14912
- };
14913
- window.addEventListener("message", handler);
14914
- window.postMessage({
14915
- type: "easycatcher",
14916
- func: "verifyExtensionEasycatcher"
14917
- }, "*");
14918
- setTimeout(() => {
14919
- if (!handled) {
14920
- window.removeEventListener("message", handler);
14921
- reject(new Error("Extens\xE3o n\xE3o detectada ou n\xE3o respondeu."));
14922
- }
14923
- }, timeoutMs);
14924
- });
14925
- }
14926
- /**
14927
- * Solicita o JSON da sessão atual capturado pela extensão.
14928
- */
14929
- getSessionData(timeoutMs = 5e3) {
14930
- return new Promise((resolve, reject) => {
14931
- let handled = false;
14932
- const handler = (event) => {
14933
- if (event.source === window && event.data.sender === "easyproctor-extension" && event.data.message_name === "data_response") {
14934
- handled = true;
14935
- window.removeEventListener("message", handler);
14936
- resolve(event.data.payload);
14937
- }
14938
- };
14939
- window.addEventListener("message", handler);
14940
- window.postMessage({
14941
- type: "easycatcher",
14942
- func: "getDataExtensionEasycatcher"
14943
- }, "*");
14944
- setTimeout(() => {
14945
- if (!handled) {
14946
- window.removeEventListener("message", handler);
14947
- reject(new Error("Timeout ao aguardar dados da extens\xE3o."));
14948
- }
14949
- }, timeoutMs);
14950
- });
14951
- }
14952
- start() {
14953
- return new Promise((resolve, reject) => {
14954
- let handled = false;
14955
- const handler = (event) => {
14956
- if (event.source === window && event.data.sender === "easyproctor-extension" && event.data.message_name === "started_confirmed") {
14957
- handled = true;
14958
- window.removeEventListener("message", handler);
14959
- resolve(true);
14960
- }
14961
- };
14962
- window.addEventListener("message", handler);
14963
- window.postMessage({ type: "easycatcher", func: "startExtensionEasycatcher" }, "*");
14964
- setTimeout(() => {
14965
- if (!handled) {
14966
- window.removeEventListener("message", handler);
14967
- reject(new Error("Timeout: Extens\xE3o n\xE3o confirmou o in\xEDcio."));
14968
- }
14969
- }, 3e3);
14970
- });
14971
- }
14972
- };
14973
-
14974
14864
  // src/modules/onChangeDevices.ts
14975
14865
  var onChangeDevices = class {
14976
14866
  constructor(repositoryDevices, proctoringId2, sessionOptions, allRecorders) {
@@ -15407,7 +15297,7 @@ var AudioRecorder = class {
15407
15297
  audio: { deviceId: this.options.microphoneId || "default" }
15408
15298
  };
15409
15299
  this.audioStream = await navigator.mediaDevices.getUserMedia(constraints);
15410
- const { startRecording, stopRecording, pauseRecording, resumeRecording } = recorder(this.audioStream, this.blobs, void 0, void 0, true);
15300
+ const { startRecording, stopRecording, pauseRecording, resumeRecording } = recorder(this.audioStream, this.blobs, null, void 0, void 0, true);
15411
15301
  this.recordingStart = startRecording;
15412
15302
  this.recordingStop = stopRecording;
15413
15303
  this.recordingPause = pauseRecording;
@@ -17998,7 +17888,7 @@ var ScreenRecorder = class {
17998
17888
  });
17999
17889
  throw NOT_SHARED_SCREEN;
18000
17890
  }
18001
- const { startRecording, stopRecording } = recorder(this.screenStream, this.blobs, this.options.onBufferSizeError, onBufferSizeErrorCallback);
17891
+ const { startRecording, stopRecording } = recorder(this.screenStream, this.blobs, null, this.options.onBufferSizeError, onBufferSizeErrorCallback);
18002
17892
  this.recordingStart = startRecording;
18003
17893
  this.recordingStop = stopRecording;
18004
17894
  this.recordingStart();
@@ -21068,7 +20958,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21068
20958
  this.connection = null;
21069
20959
  this.context = context;
21070
20960
  this.onRealtimeAlertsCallback = onRealtimeAlertsCallback;
21071
- console.log("context -> ", context);
21072
20961
  this.backend = new BackendService({
21073
20962
  type: (context == null ? void 0 : context.type) || "prod",
21074
20963
  token: context.token
@@ -21082,7 +20971,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21082
20971
  try {
21083
20972
  this.transmissionOk = false;
21084
20973
  const response = await this.backend.externalCameraCheckTransmission("" + this.externalSessionId);
21085
- console.log(response);
21086
20974
  let attempts = 0;
21087
20975
  while (!this.transmissionOk && attempts <= 5) {
21088
20976
  await new Promise((resolve) => setTimeout(resolve, 2e3));
@@ -21099,16 +20987,13 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21099
20987
  try {
21100
20988
  this.proctoringId = proctoringId2;
21101
20989
  const response = await this.backend.externalCameraStartTransmission("" + this.externalSessionId, proctoringId2);
21102
- console.log(response);
21103
20990
  } catch (error) {
21104
- console.error("Erro ao iniciar transmiss\xE3o:", error);
21105
20991
  throw new Error("N\xE3o foi poss\xEDvel iniciar a transmiss\xE3o.");
21106
20992
  }
21107
20993
  }
21108
20994
  async goToPositionGuide() {
21109
20995
  try {
21110
20996
  const response = await this.backend.goToExternalCameraPositionStep("" + this.externalSessionId);
21111
- console.log(response);
21112
20997
  } catch (error) {
21113
20998
  console.error("Erro ao enviar comando de Position:", error);
21114
20999
  throw new Error("N\xE3o foi poss\xEDvel enviar comando de Position Guide.");
@@ -21118,7 +21003,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21118
21003
  if (this.connection) {
21119
21004
  const actionMessage = new ActionMessage();
21120
21005
  actionMessage.command = "Reset";
21121
- console.log("Enviando comando 'Reset' para o aplicativo...");
21122
21006
  this.connection.invoke(
21123
21007
  "SendAction",
21124
21008
  this.externalSessionId,
@@ -21132,7 +21016,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21132
21016
  this.onTakePictureCallback = onTakePictureCallback;
21133
21017
  const actionMessage = new ActionMessage();
21134
21018
  actionMessage.command = "Capture";
21135
- console.log("Enviando comando 'Capture' para o aplicativo...");
21136
21019
  this.connection.invoke(
21137
21020
  "SendAction",
21138
21021
  this.externalSessionId,
@@ -21151,7 +21034,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21151
21034
  await this.reset();
21152
21035
  const response = await this.backend.externalCameraStartSession();
21153
21036
  this.externalSessionId = response.externalSessionId;
21154
- console.log(this.externalSessionId);
21155
21037
  this.currentStep = 0 /* STARTED */;
21156
21038
  const pairingObject = {
21157
21039
  externalSessionId: this.externalSessionId,
@@ -21160,7 +21042,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21160
21042
  };
21161
21043
  const pairingDataString = JSON.stringify(pairingObject);
21162
21044
  this.qrCodeBase64Image = await import_qrcode.default.toDataURL(pairingDataString);
21163
- console.log(this.qrCodeBase64Image);
21164
21045
  return this.qrCodeBase64Image;
21165
21046
  } catch (error) {
21166
21047
  this.disconnectWebSocket();
@@ -21259,7 +21140,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21259
21140
  var _a2;
21260
21141
  const actionMessage = new ActionMessage();
21261
21142
  actionMessage.command = "Cancel";
21262
- console.log("Enviando comando 'Cancel' para o aplicativo...");
21263
21143
  (_a2 = this.connection) == null ? void 0 : _a2.invoke(
21264
21144
  "SendAction",
21265
21145
  this.externalSessionId,
@@ -21599,8 +21479,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21599
21479
  this.connection.on(
21600
21480
  "ReceiveMessage",
21601
21481
  (sessionId, messageStr) => {
21602
- console.log("sessionId: ", sessionId);
21603
- console.log("Message: ", messageStr);
21604
21482
  if (sessionId !== this.externalSessionId) {
21605
21483
  console.warn("Sess\xE3o diferente!");
21606
21484
  return;
@@ -21608,7 +21486,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21608
21486
  try {
21609
21487
  const messageKey = messageStr;
21610
21488
  const message = ExternalCameraStatusEnum[messageKey];
21611
- console.log("Mensagem -> ", message);
21612
21489
  this.handleWebSocketMessage(message);
21613
21490
  } catch (e3) {
21614
21491
  console.error("Erro ao processar mensagem do WebSocket:", e3);
@@ -21618,8 +21495,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21618
21495
  this.connection.on(
21619
21496
  "ReceiveAction",
21620
21497
  (sessionId, actionMessage) => {
21621
- console.log("sessionId: ", sessionId);
21622
- console.log("Message: ", actionMessage);
21623
21498
  if (sessionId !== this.externalSessionId) {
21624
21499
  console.warn("Sess\xE3o diferente!");
21625
21500
  return;
@@ -21633,7 +21508,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21633
21508
  );
21634
21509
  try {
21635
21510
  await this.connection.start();
21636
- console.log("Conectado ao Hub SignalR com sucesso!");
21637
21511
  } catch (err) {
21638
21512
  console.error("Falha ao conectar ou entrar no grupo do SignalR: ", err);
21639
21513
  throw new Error("N\xE3o foi poss\xEDvel conectar ao servi\xE7o em tempo real.");
@@ -21760,7 +21634,6 @@ var _ExternalCameraChecker = class _ExternalCameraChecker {
21760
21634
  if (this.connection) {
21761
21635
  try {
21762
21636
  await this.connection.stop();
21763
- console.log("Desconectado do SignalR.");
21764
21637
  } catch (err) {
21765
21638
  console.error("Erro ao desconectar do SignalR:", err);
21766
21639
  } finally {
@@ -21794,7 +21667,6 @@ var Proctoring = class {
21794
21667
  constructor(context) {
21795
21668
  this.context = context;
21796
21669
  this.deviceData = null;
21797
- this.sessionStartTime = 0;
21798
21670
  this.paramsConfig = {
21799
21671
  audioBehaviourParameters: {
21800
21672
  recordingBitrate: 128,
@@ -22018,7 +21890,10 @@ var Proctoring = class {
22018
21890
  width: this.videoOptions.width,
22019
21891
  height: this.videoOptions.height,
22020
21892
  minWidth: this.videoOptions.minWidth,
22021
- minHeight: this.videoOptions.minHeight
21893
+ minHeight: this.videoOptions.minHeight,
21894
+ timeSlice: this.videoOptions.timeSlice,
21895
+ videoBitsPerSecond: this.videoOptions.videoBitsPerSecond,
21896
+ mimeType: this.videoOptions.mimeType
22022
21897
  },
22023
21898
  this.paramsConfig,
22024
21899
  this.backend,
@@ -22069,10 +21944,7 @@ var Proctoring = class {
22069
21944
  if (this.context.token === void 0) {
22070
21945
  throw TOKEN_MISSING;
22071
21946
  }
22072
- if (options.useChallenge) {
22073
- this.extensionEasycatcher = new ExtensionEasyCatcher();
22074
- }
22075
- this.extension = new ExtensionEasyProctor();
21947
+ this.extension = new Extension();
22076
21948
  this.extension.addEventListener();
22077
21949
  const baseURL = this.backend.selectBaseUrl(this.context.type);
22078
21950
  const devices = await enumarateDevices();
@@ -22121,7 +21993,6 @@ var Proctoring = class {
22121
21993
  } catch (error) {
22122
21994
  throw EXTERNAL_CAMERA_NOT_STARTED;
22123
21995
  }
22124
- this.sessionStartTime = Date.now();
22125
21996
  this.allRecorders.cameraRecorder.setProctoringId(this.proctoringId);
22126
21997
  this.allRecorders.noiseRecorder.setProctoringId(this.proctoringId);
22127
21998
  this.proctoringSession.setProctoringId(this.proctoringId);
@@ -22297,7 +22168,6 @@ Upload Services: ${uploaderServices}`,
22297
22168
  });
22298
22169
  if (this.appChecker) {
22299
22170
  const externalSessionId = this.appChecker.getExternalCameraSessionId();
22300
- console.log("externalSessionId -> ", externalSessionId);
22301
22171
  if (externalSessionId != "null") {
22302
22172
  await this.backend.externalCameraFinish(externalSessionId);
22303
22173
  }
@@ -22420,59 +22290,6 @@ Error: ` + error
22420
22290
  _screenStream: (_a2 = this.allRecorders.screenRecorder) == null ? void 0 : _a2.screenStream
22421
22291
  };
22422
22292
  }
22423
- async startChallenge(templateId) {
22424
- if (!this.sessionOptions.useChallenge) {
22425
- throw new Error("useChallenge is set as false on start method");
22426
- }
22427
- await this.extensionEasycatcher.checkExtensionInstalled().catch((err) => {
22428
- throw new Error("EasyCatcher Extension is not installed");
22429
- });
22430
- this.extensionEasycatcher.start();
22431
- const start = Date.now() - this.sessionStartTime;
22432
- await this.backend.startChallenge({
22433
- proctoringId: this.proctoringId,
22434
- templateId,
22435
- start
22436
- }).then((resp) => {
22437
- console.log(resp);
22438
- this.challengeId = resp.id;
22439
- }).catch((reason) => {
22440
- trackers.registerError(
22441
- this.proctoringId,
22442
- "N\xE3o foi poss\xEDvel iniciar desafio!"
22443
- );
22444
- throw reason;
22445
- });
22446
- this.isChallengeRunning = true;
22447
- }
22448
- async stopChallenge() {
22449
- if (!this.isChallengeRunning) {
22450
- throw new Error("Challenge not started");
22451
- }
22452
- try {
22453
- const sessionData = await this.extensionEasycatcher.getSessionData();
22454
- const end = Date.now() - this.sessionStartTime;
22455
- await this.backend.stopChallenge(
22456
- this.challengeId,
22457
- {
22458
- end,
22459
- data: sessionData
22460
- }
22461
- ).catch((reason) => {
22462
- trackers.registerError(
22463
- this.proctoringId,
22464
- "N\xE3o foi poss\xEDvel finalizar o desafio no backend!"
22465
- );
22466
- return void 0;
22467
- });
22468
- this.isChallengeRunning = false;
22469
- } catch (error) {
22470
- trackers.registerError(
22471
- this.proctoringId,
22472
- "Erro ao recuperar dados da extens\xE3o: " + error.message
22473
- );
22474
- }
22475
- }
22476
22293
  };
22477
22294
 
22478
22295
  // src/proctoring/SignTerm.ts
@@ -22700,8 +22517,6 @@ function useProctoring(proctoringOptions, enviromentConfig = "prod") {
22700
22517
  return originalStart(parameters2, videoOptions);
22701
22518
  };
22702
22519
  const finish = proctoring.finish.bind(proctoring);
22703
- const startChallenge = proctoring.startChallenge.bind(proctoring);
22704
- const stopChallenge = proctoring.stopChallenge.bind(proctoring);
22705
22520
  const pause = proctoring.pause.bind(proctoring);
22706
22521
  const resume = proctoring.resume.bind(proctoring);
22707
22522
  const onFocus = proctoring.setOnFocusCallback.bind(proctoring);
@@ -22724,8 +22539,6 @@ function useProctoring(proctoringOptions, enviromentConfig = "prod") {
22724
22539
  login,
22725
22540
  start,
22726
22541
  finish,
22727
- startChallenge,
22728
- stopChallenge,
22729
22542
  onFocus,
22730
22543
  onLostFocus,
22731
22544
  onChangeDevices: onChangeDevices2,
@@ -1,5 +1,5 @@
1
1
  import { ProctoringFinisherOptions } from "../proctoring/proctoring";
2
- export declare class ExtensionEasyProctor {
2
+ export declare class Extension {
3
3
  hasExtension: boolean;
4
4
  tryes: number;
5
5
  responseStart: boolean;