Commit fc8d454a authored by 乐宝呗666's avatar 乐宝呗666

修改20s问题

parent 3a7b46a5
......@@ -97,7 +97,7 @@
<img src="@/assets/images/applets/tip.png" alt />
<span>
最多支持上传
<b>3</b> 段视频,每段时长 <b>20s</b>
<b>3</b> 段视频,每段时长 <b>30s</b>
</span>
</div>
</div>
......@@ -200,20 +200,21 @@ export default {
this.showBoard = false;
},
beforeVideo(file) {
console.log(file)
this.timeOutVideo = false
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
if (duration > 21) {
if (duration > 31) {
this.timeOutVideo = true
this.fileList.forEach((item,index)=>{
if(item.file.lastModified===file.lastModified){
this.fileList.splice(index,1)
}
})
this.$toast.fail("上传视频时长不能超过20秒");
this.$toast.fail("上传视频时长不能超过30秒");
return false;
}
});
......
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