标签:canvas tco cap end log VID query pen etc
function captureImage () {
var scale = 0.25;
var txt = document.querySelector(‘div p .external‘);
video = document.querySelector("video");
var canvas = document.createElement(‘canvas‘);
canvas.width = video.videoWidth * scale;
canvas.height = video.videoHeight * scale;
canvas.getContext("2d").drawImage(video, 0, 0, canvas.width, canvas.height);
var img = document.createElement("img");
img.src = canvas.toDataURL();
// console.log(img.src)
txt.appendChild(img)
}
标签:canvas tco cap end log VID query pen etc
原文地址:https://www.cnblogs.com/aashui/p/14954462.html