MDN - navigator.mediaDevices.getUserMedia(): Still photo capture demo
This example demonstrates how to set up a media stream using your built-in
webcam, fetch an image from that stream, and create a PNG using that image.
Visit our article
Taking still photos with WebRTC
to learn more about the technologies used here.