几行代码就实现了,如下:
//视频地址
var video= new Audio('aaa.mp4');
var duration = 0;
video.addEventListener("loadedmetadata", function (e) {
duration = video.duration;
console.log('视频时长为', duration);
$.ajax();
});