Get a preview of any file
$ npm install @file-detail/core
import { previewer } from '@file-detail/core'
type PreviewerParameters = {
previewParameters: PreviewParameters;
limitFunc?: (isSupport: IsSupport) => Promise<boolean>;
};
const result:PreviewerResult = await previewer(previewerParameters: PreviewerParameters)
console.log('result', result)
// result {
// status: true,
// errorMsg: '',
// metaData: {
// width: 480,
// height: 270,
// images: [
// '/file-detail/assets/video/output/example.ogg_1662719787838.jpg'
// ],
// mainColor: [ 7, 8, 13 ],
// palette: [ [Array], [Array], [Array], [Array], [Array] ],
// name: 'example',
// ext: 'ogg',
// size: 1.73,
// unit: 'MB',
// total: 1
// }
// }
- video
- image
- office
- design
- text
- 3d
- af