我使用画布制作了截图。现在截图想要存储成折叠。这就是我所做的。
video = document.getElementById('localVideo');
img = document.getElementById('image');
CAPTURE = document.getElementById('Capture');
CAPTURE.onclick = sendDataCAPTURE;
const canvas = document.createElement('canvas');
function sendDataCAPTURE() {
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext('2d').drawImage(video, 0, 0);
img.src = canvas.toDataURL('image/png', 1);
console.log('canvas URL' + canvas.toDataURL('image/webp'))
}