支持webm视频格式上传和预览

This commit is contained in:
pan 2024-10-31 16:07:51 +08:00
parent 325f34b243
commit 7f705ee63d
3 changed files with 21 additions and 11 deletions

View File

@ -151,13 +151,23 @@ export default {
self.$emit('previewLoadingClose')
return
}
if(row.fileName.endsWith(".mp4")){
this.playerOptions.sources = [
{
src: row.fileUrl,
type: 'video/mp4'
}
]
if(row.fileName.endsWith(".mp4") || row.fileName.endsWith(".webm")){
if(row.fileName.endsWith(".mp4")){
this.playerOptions.sources = [
{
src: row.fileUrl,
type: 'video/mp4'
}
]
}else{
this.playerOptions.sources = [
{
src: row.fileUrl,
type: 'video/webm'
}
]
}
self.dialogVisible = true
self.isVideos = true;
self.previewLoading = false

View File

@ -134,7 +134,7 @@
<uploadVue
:display="editStatus"
:uploadUrl="uploadFileUrl"
:type="['.txt','.doc','.docx','.pdf','.mp4','.zip','.rar','.7z','.png','.jpg','.jpeg']"
:type="['.txt','.doc','.docx','.pdf','.mp4','.webm','.zip','.rar','.7z','.png','.jpg','.jpeg']"
:acceptType="acceptType"
:isMultiple="true"
:dataFile="dataFile"
@ -355,7 +355,7 @@
deptOptions:[],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
fileData: null,
acceptType: ".txt,.docx,.pdf,.mp4,.zip,.rar,.7z,.png,.jpg",
acceptType: ".txt,.docx,.pdf,.mp4,.webm,.zip,.rar,.7z,.png,.jpg",
editStatus: true,
toolDataInfo: [],
dataFile: [],

View File

@ -262,7 +262,7 @@
<uploadVue
:display="editStatus"
:uploadUrl="uploadFileUrl"
:type="['.txt','.doc','.docx','.pdf','.mp4','.zip','.rar','.7z','.png','.jpg','.jpeg']"
:type="['.txt','.doc','.docx','.pdf','.mp4','.webm','.zip','.rar','.7z','.png','.jpg','.jpeg']"
:acceptType="acceptType"
:isMultiple="true"
:dataFile="dataFile"
@ -584,7 +584,7 @@ export default {
curDeptName: null,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
acceptType: ".txt,.docx,.pdf,.mp4,.zip,.rar,.7z,.png,.jpg",
acceptType: ".txt,.docx,.pdf,.mp4,.webm,.zip,.rar,.7z,.png,.jpg",
dataFile: [],
detailBoolean: false,
attachmentList: [],