Commit 541cc8dd authored by 乐宝呗666's avatar 乐宝呗666

修改视频市场为30s

parent fc8d454a
......@@ -200,25 +200,30 @@ export default {
this.showBoard = false;
},
beforeVideo(file) {
console.log(file)
this.timeOutVideo = false
if(Array.isArray(file)){
file.forEach(item=>{
this.createVideo(item)
})
}else{
this.createVideo(file)
}
return true
},
createVideo(file){
let _URL = window.URL || window.webkitURL;
let videoUrl = _URL.createObjectURL(file);
let audioElement = new Audio(videoUrl);
audioElement.addEventListener("loadedmetadata", () => {
let duration = audioElement.duration; //时长为秒,小数,182.36
console.log(duration)
if (duration > 31) {
this.timeOutVideo = true
this.fileList.forEach((item,index)=>{
if(item.file.lastModified===file.lastModified){
this.fileList.splice(index,1)
}
})
this.fileList = []
this.$toast.fail("上传视频时长不能超过30秒");
return false;
}
});
return true
},
// 打开日历
onDisplay() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment