<capture-photo>

A custom element that implements the MediaDevices.getUserMedia() method to capture a photo in the browser.

Source code & documentation

Demo

Open the browser's console to watch emitted events.

Customize component

Attributes
Note, that some of the attributes depend on the camera hardware support, so they may not work on all devices.
Source code
<capture-photo auto-play></capture-photo>

License

The MIT License (MIT)