Commit aaf9349f authored by 田翔's avatar 田翔

fix: 支持mov文件预览

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