Tomar foto con javascript y guardar en el dispositivo
// the variable `takePhoto` is the button // define the function that will be executed when the button is clicked function takePhoto() { // get a HTML element from the DOM, in this case the video element const video = document.getElementById('video'); // get a HTML element from the DOM, in this case the canvas element const canvas = document.getElementById('canvas'); const context = canvas.getContext('2d'); // draw the image from the video element to the canvas element context.drawImage(video, 0, 0, canvas.width, canvas.height); // get the data from the canvas element (the image) canvas.toBlob(function(blob) { // save the image to the phone saveAs(blob, 'filtered.png'); }); }