This commit is contained in:
Timothy Jaeryang Baek
2025-12-21 20:49:17 +04:00
parent a1155dfeb7
commit 96ec66a89c

View File

@@ -334,8 +334,9 @@
// Convert the canvas to a Base64 image URL
const imageUrl = canvas.toDataURL('image/png');
// Add the captured image to the files array to render it
files = [...files, { type: 'image', url: imageUrl }];
const blob = await (await fetch(imageUrl)).blob();
const file = new File([blob], `screen-capture-${Date.now()}.png`, { type: 'image/png' });
inputFilesHandler([file]);
// Clean memory: Clear video srcObject
video.srcObject = null;
} catch (error) {