plupload 获取视频时长

时间:2020-04-02 11:09:28   收藏:0   阅读:214
file 已经被拦截处理,
file.getNative()获取真正的对象



let fileurl = URL.createObjectURL(file.getNative())
let audioElement = new Audio(fileurl)
audioElement.addEventListener(‘loadedmetadata‘, _event => {
that.$emit(‘getValue‘, {
url: key,
originalFileName: fileN.name,
duration:audioElement.duration
})
})

原文:https://www.cnblogs.com/CaptainLin/p/12617634.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!