<div class="camera">
<video id="video">Video stream not available.</video>
</div>
<canvas id="canvas"> </canvas>
<div class="output">
<img id="photo" alt="The screen capture will appear in this box." />
</div>
<button id="captureButton">Take photo</button>
<form asp-action="GuardarFoto" method="post" enctype="multipart/form-data">
<input type="file" name="foto" id="foto" />
<button type="submit">Subir foto</button>
</form>
<script>
window.addEventListener('load', function() {
var video = document.getElementById('video');