Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

video preview javascript

$(document).on("change",".file_multi_video",function(evt){
  
  var this_ = $(this).parent();
  var dataid = $(this).attr('data-id');
  var files = !!this.files ? this.files : [];
  if (!files.length || !window.FileReader) return; 
  
  if (/^video/.test( files[0].type)){ // only video file
    var reader = new FileReader(); // instance of the FileReader
    reader.readAsDataURL(files[0]); // read the local file
    reader.onloadend = function(){ // set video data as background of div
          
          var video = document.getElementById('video_here');
          video.src = this.result;
      }
   }
  
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: refresh page on div click 
Javascript :: remove element from dictionary javascript 
Javascript :: react native release apk command 
Javascript :: how to create list of years js 
Javascript :: replace comma by new line in js 
Javascript :: push-method-in-react-hooks-usestate 
Javascript :: fetch api map 
Javascript :: ex. javascript loop aray 
Javascript :: toggle in react 
Javascript :: how to check checked checkbox in jquery 
Javascript :: javascript domcontentloaded 
Javascript :: unexpected token react native stack navigation 
Javascript :: (intermediate value).getdate is not a function 
Javascript :: postman test check response status 
Javascript :: anchor element onclick not working 
Javascript :: get next element of array javascript 
Javascript :: js datetime local 
Javascript :: should i use google pay 
Javascript :: jquery validation submit handler 
Javascript :: sum of digits in a whole number javascript 
Javascript :: random int javascript 
Javascript :: react-select default menu open 
Javascript :: install proptypes react 
Javascript :: refresh after delete in express 
Javascript :: Handle an input with React hooks 
Javascript :: json to csv nodejs 
Javascript :: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory 
Javascript :: scroll element by javascript 
Javascript :: javascript combine dictionaries 
Javascript :: discord.js messageDelete 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =