javascript - Get Video Duration jQuery -
i have question. trying duration of source. i want next: when page load need duration of source problem when want duration apparently not visible, can duration when press button. need know duration since start because need calculate position on video/audio , send through currenttime. i try "alert" result "nan". this code actually: $( document ).ready(function() { var asset = $('#asset')[0]; // obtiene el objeto var tipo = $('#asset').attr('class'); // video, audio, pdf var duracion = asset.duration; var porcentaje = $('#porcentaje').attr('data-percent'); var tiempo = (porcentaje*duracion)/100; asset.currenttime = tiempo; alert(duracion); // nan $("#guardar").click(function() { var avance = asset.currenttime; if(tipo == 'video' || tipo == 'audio'){ porcentaje = parseint((avance*100)/duracion); } else if(tipo =...