feat(transcode): add audio file support with AAC stereo mp4 proxy and styled viewer

This commit is contained in:
yiling
2026-07-05 15:11:19 +08:00
parent 9a7abaed1a
commit a2e982f2e6
18 changed files with 577 additions and 105 deletions
@@ -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 (