Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to take a input video on browser using javascript and play it

<input type="file" accept="video/*" capture="camera" id="recorder">
  <video id="player" controls> </video>
      <script>  
            var recorder = document.getElementById('recorder'); 
            var player = document.getElementById('player');  
                  recorder.addEventListener('change', function(e) {    
                    var file = e.target.files[0];   
        
                    player.src = URL.createObjectURL(file);  });
       </script>
 
PREVIOUS NEXT
Tagged: #input #video #browser #javascript #play
ADD COMMENT
Topic
Name
7+4 =