proctor-ai-sdk
Version:
A powerful SDK for preventing cheating during online exams using face detection, voice detection, and tab monitoring.
10 lines (8 loc) • 360 B
JavaScript
export const takeSnapshot = (videoElement) => {
const canvas = document.createElement("canvas");
canvas.width = videoElement.videoWidth;
canvas.height = videoElement.videoHeight;
const ctx = canvas.getContext("2d");
ctx.drawImage(videoElement, 0, 0, canvas.width, canvas.height);
return canvas.toDataURL("image/png"); // base64 image
};