mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 19:34:38 +00:00
feat(transcode): add audio file support with AAC stereo mp4 proxy and styled viewer
This commit is contained in:
@@ -3,7 +3,7 @@ import { client } from '@/ui/api/client'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
|
||||
import { useDraggable } from '@dnd-kit/react'
|
||||
import { File, Folder, MoreVertical } from 'lucide-react'
|
||||
import { File, Folder, MoreVertical, AudioLines } from 'lucide-react'
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
import type { DragState } from '../dnd-types'
|
||||
@@ -214,6 +214,9 @@ export function FileListItem({
|
||||
alt=""
|
||||
className="w-full h-full object-cover"
|
||||
/>
|
||||
) : displayItem.preview?.mediaType?.startsWith('audio/') ||
|
||||
displayItem.mediaType?.startsWith('audio/') ? (
|
||||
<AudioLines className="h-4 w-4 text-muted-foreground" />
|
||||
) : displayItem.type === 'folder' ? (
|
||||
<Folder className="h-4 w-4 text-primary" />
|
||||
) : (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { File, Folder } from 'lucide-react'
|
||||
import { File, Folder, AudioLines } from 'lucide-react'
|
||||
import { SpriteScrubber } from '../sprite-scrubber'
|
||||
import { formatTime } from '../viewers/video/utils'
|
||||
|
||||
@@ -63,6 +63,15 @@ export const FilePreview = ({ item, showDuration = false }: FilePreviewProps) =>
|
||||
)
|
||||
}
|
||||
|
||||
const isAudio = item.preview?.mediaType?.startsWith('audio/')
|
||||
if (isAudio) {
|
||||
return (
|
||||
<div className="w-full h-full flex items-center justify-center bg-muted">
|
||||
<AudioLines className="w-8 h-8 text-muted-foreground" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// Assumption: folders in latestChildren have no media type.
|
||||
if (!item.type) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user