Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get duration video tag

$(document).ready(function() {
  var data  = $('#file-input')[0]; // File from <input type="file"> tag
  var reader = new FileReader();
  reader.addEventListener('load', function() {
    var video = $('<video class="uploaded_video_src" controls></video>');

    if (reader.result) {
      $('.uploaded_video_src').append(`<source src="${reader.result}" type="video/mp4">`); // Add type attr for support for some .mov files

      video.on('loadedmetadata', function() {
        console.log('duration:', $(this)[0].duration);
      });
    }
  });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: state in constructor javascript 
Javascript :: preload 
Javascript :: span change jquery 
Javascript :: nvm check version available to download 
Javascript :: comparing two arrays in javascript returning differences 
Javascript :: es6 method definition syntax 
Javascript :: if between two numbers javascript 
Javascript :: how to create a folder using fs in node js 
Javascript :: get file extension nodejs 
Javascript :: run function then empty it 
Javascript :: .NET number values such as positive and negative infinity cannot be written as valid JSON. 
Javascript :: file upload javascript 
Javascript :: preg_match javascript 
Javascript :: get server by id discord.js 
Javascript :: js loop to array backwards 
Javascript :: largest sum contiguous subarray javascript 
Javascript :: wait js 
Javascript :: vscode 
Javascript :: oneerror javascript image 
Javascript :: display toastr success 
Javascript :: how to filter json array in javascript 
Javascript :: char array to string javascript 
Javascript :: get option value jquery 
Javascript :: equivalent method load jquery with javascript 
Javascript :: what is functional composition 
Javascript :: javascript sort map by value 
Javascript :: base64 to image nodejs 
Javascript :: JavaScript Number() Function 
Javascript :: mongo mongoose join aggregation lookup 
Javascript :: get the whole value of a number javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =