<button id="takePhoto">Take Photo</button>
<input class="hidden" id="zoom" type="range" step="20">
</div>
<video autoplay playsinline class="hidden"></video>
<img>
<canvas class="hidden"></canvas>
// Get a Blob from the currently selected camera source and
// display this with an img element.
function takePhoto() {
imageCapture.takePhoto().then(function(blob) {
console.log('Took photo:', blob);
img.classList.remove('hidden');
img.src = URL.createObjectURL(blob);
}).catch(function(error) {
console.log('takePhoto() error: ', error);
});
}
источник: https://simpl.info/imagecapture/