Commit aaf9349f authored by 田翔's avatar 田翔

fix: 支持mov文件预览

parent 5ea3a80a
{
"name": "panda-xform",
"version": "5.8.3",
"description": "5.8.3 图片预览与导出模板问题",
"version": "5.8.5",
"description": "5.8.5 支持mov文件预览",
"keywords": [
"panda-xform"
],
......
......@@ -58,6 +58,9 @@ const getFileType = (fileName) => {
if (fileName.includes('mp4')) {
return 'mp4'
}
if (fileName.includes("MOV")) {
return "MOV";
}
}
return null
}
......@@ -237,6 +240,14 @@ const FileUpload = (props) => {
</div>
)
}
if (["mp4", "MOV"].includes(showFile.fileType)) {
return (
<video controls="controls" className="fl" width="100%" height="100%">
<source src={showFile.filePath} type="video/mp4" />
<source src={showFile.filePath} type="video/quicktime" />
</video>
);
}
return (
<FileViewer
className='fileViewer'
......@@ -330,7 +341,7 @@ const FileUpload = (props) => {
visible={visible}
destroyOnClose
onCancel={() => setVisible(false)}
bodyStyle={{ height: 650, overflowY: showFile.fileType.includes('xlsx') ? 'none' : "auto" }}
bodyStyle={{ height: 650, overflowY: showFile?.fileType?.includes('xlsx') ? 'none' : "auto" }}
>
{elemet()}
</Drag>
......
......@@ -22,7 +22,8 @@
background: url('@{imgSrc}/音乐.png');
background-size: 100% 100%;
}
&[type="mp4"] {
&[type="mp4"],
&[type="MOV"] {
background: url('@{imgSrc}/视频.png');
background-size: 100% 100%;
}
......
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