参考:https://stackoverflow.com/questions/29285056/get-video-duration-when-input-a-video-file
function _getVideoDuration(file, callback) {
const video = document.createElement('video');
video.preload = 'metadata';
video.onloadedmetadata = function () {
const url = video.src;
const duration = video.duration;
video.src = '';//避免下一句revoke后报错
window.URL.revokeObjectURL(url);
callback(duration);
};
video.src = URL.createObjectURL(file);
}