截图函数

     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)
        }

上一篇:mapbox源码解析(mvp矩阵)


下一篇:EyeQ4烧录步骤