add video and audio player preview

This commit is contained in:
spencerwooo
2021-06-24 14:54:59 +01:00
parent d437402577
commit 2ea2db2cee
6 changed files with 142 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
import { FunctionComponent } from 'react'
import ReactPlayer from 'react-player'
export const AudioPreview: FunctionComponent<{ file: any }> = ({ file }) => {
return (
<div className="bg-white rounded shadow p-3 w-full">
<div className="text-center mb-6">{file.name}</div>
<ReactPlayer
url={file['@microsoft.graph.downloadUrl']}
controls
width="100%"
height="48px"
config={{ file: { forceAudio: true } }}
/>
</div>
)
}