📜  如何在 javascript 代码示例中获取视频时长

📅  最后修改于: 2022-03-11 15:03:05.680000             🧑  作者: Mango

代码示例1
const i = setInterval(function() {
    if(video.readyState > 0) {
        var minutes = parseInt(video.duration / 60, 10);
        var seconds = video.duration % 60;
        clearInterval(i);
    }
}, 200);