mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 06:24:30 +00:00
feat(transcode): add PDF proxy support for TXT and CSV files
This commit is contained in:
@@ -5,7 +5,7 @@ import { CompareImagePane } from './compare-image-pane'
|
||||
export const imageTypeDefinition: FileTypeDefinition = {
|
||||
id: 'image',
|
||||
name: 'Image',
|
||||
match: (file) => !!file.mediaType?.startsWith('image/'),
|
||||
match: (file) => file.proxyType === 'image',
|
||||
viewer: ImageViewer,
|
||||
comparePane: CompareImagePane,
|
||||
commentsConfig: {
|
||||
|
||||
@@ -4,7 +4,7 @@ import PdfViewer from './pdf-viewer'
|
||||
export const pdfTypeDefinition: FileTypeDefinition = {
|
||||
id: 'pdf',
|
||||
name: 'PDF',
|
||||
match: (file) => file.mediaType === 'application/pdf' || file.name.toLowerCase().endsWith('.pdf'),
|
||||
match: (file) => file.proxyType === 'pdf',
|
||||
viewer: PdfViewer,
|
||||
commentsConfig: {
|
||||
hasTimestamp: true,
|
||||
|
||||
@@ -132,7 +132,7 @@ export const PdfViewer = React.forwardRef<MediaController, FileViewerProps>(
|
||||
}
|
||||
}, [])
|
||||
|
||||
const fileUrl = file.media?.original?.downloadUrl
|
||||
const fileUrl = file.media?.pdfTranscode?.url || file.media?.original?.downloadUrl
|
||||
|
||||
// Load PDF Document
|
||||
useEffect(() => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CompareVideoPane } from './compare-video-pane'
|
||||
export const videoTypeDefinition: FileTypeDefinition = {
|
||||
id: 'video',
|
||||
name: 'Video',
|
||||
match: (file) => !!file.mediaType?.startsWith('video/') || !!file.mediaType?.startsWith('audio/'),
|
||||
match: (file) => file.proxyType === 'video' || file.proxyType === 'audio',
|
||||
viewer: VideoViewer,
|
||||
comparePane: CompareVideoPane,
|
||||
commentsConfig: {
|
||||
|
||||
Reference in New Issue
Block a user