el-upload结合el-progress实现视频上传进度

 

请保证视频格式正确,且不超过5M

beforeUploadVideo(file) {const isLt5M = file.size / 1024 / 1024 < 5;if (['video/mp4', 'video/ogg', 'video/flv','video/avi','video/wmv','video/rmvb'].indexOf(file.type) == -1) {this.$message.error('请上传正确的视频格式');return false;}if (!isLt5M) {this.$message.error('上传视频大小不能超过5MB哦!');return false;} }, uploadVideoProcess(event, file, fileList){this.videoFlag = true;this.videoUploadPercent = file.percentage.toFixed(0); // file.percentage获取文件上传进度 }, handleVideoSuccess(res, file) {this.videoFlag = false;this.videoUploadPercent = 0;if(res.status == 200){this.videoForm.videoUploadId = res.data.uploadId;this.videoForm.Video = res.data.uploadUrl;}else{this.$message.error('视频上传失败,请重新上传!');} },


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部