我用一個簡單的快照片段,以實現WebRTC的WebRTC和帆布:爲什麼它始終顯示爲300像素* 150像素
function snap() {
var snapshot = document.getElementById("snapshot"),
video = document.querySelector("video");
snapshot.getContext("2d").drawImage(video, 0, 0, snapshot.width, snapshot.height);
console.log(snapshot.toDataURL("image/png"));
}
來源:https://lincolnloop.com/blog/what-webrtc/
我的問題是,snpashot總是300X * 150像素。大小!
如何讓它變大?