Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// run in console on a https page
stream = await navigator.mediaDevices.getUserMedia({ video: true, audio:true })
video = document.createElement("video");
video.muted = true;
video.srcObject = stream;
canvas = document.createElement("canvas")
ctx = canvas.getContext("2d")
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
imageData = ctx.getImageData(0,0,video.videoWidth, video.videoHeight)
value =, i) => cur + i,0)
result = value /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.