mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 20:34:28 +00:00
feat(asset): replace mediaType/mimeType logic with proxyType
This commit is contained in:
@@ -118,7 +118,7 @@ export const CompareVideoPane = forwardRef<ComparePaneHandle, CompareVideoPanePr
|
||||
const [currentResolution, setCurrentResolution] = useState(initialRes?.resolution ?? 'Original')
|
||||
const currentSrcRef = useRef(initialRes?.url)
|
||||
|
||||
const isAudio = file.mediaType?.startsWith('audio/')
|
||||
const isAudio = file.proxyType === 'audio'
|
||||
const { currentFrame, seekToFrame } = useFramePlayer(videoRef, frameRate, totalFrames, isAudio)
|
||||
|
||||
const zoomRef = useRef(zoom)
|
||||
@@ -440,7 +440,7 @@ export const CompareVideoPane = forwardRef<ComparePaneHandle, CompareVideoPanePr
|
||||
>
|
||||
<div ref={videoContainerRef} className="absolute inset-0 z-[-1]" />
|
||||
|
||||
{file.mediaType?.startsWith('audio/') ? (
|
||||
{isAudio ? (
|
||||
<div className="flex flex-col items-center justify-center text-muted-foreground w-full h-full pointer-events-none select-none">
|
||||
<AudioLines
|
||||
className={cn(
|
||||
|
||||
@@ -114,7 +114,7 @@ export const VideoControlBar: React.FC<ControlBarProps> = ({
|
||||
// fullscreen). Compare keeps it in-flow. Colors stay theme-aware either way.
|
||||
const overlay = state.isFullScreen && floatOverlayInFullScreen
|
||||
|
||||
const isAudio = data.mediaType?.startsWith('audio/')
|
||||
const isAudio = data.proxyType === 'audio'
|
||||
const previewResolutions = resolutions.filter((r) => !r.isRaw)
|
||||
|
||||
const startTimecode = data.media?.metadata?.startTimecode
|
||||
|
||||
@@ -194,7 +194,7 @@ const VideoViewer = React.forwardRef<MediaController, FileViewerProps>(
|
||||
const dbTotalFrames = metadata?.totalFrames || 0
|
||||
const containerDuration = metadata?.duration || 0
|
||||
|
||||
const isAudio = data.mediaType?.startsWith('audio/')
|
||||
const isAudio = data.proxyType === 'audio'
|
||||
const totalFrames = resolveTotalFrames({ dbTotalFrames, containerDuration, frameRate })
|
||||
const { currentFrame, seekToFrame } = useFramePlayer(videoRef, frameRate, totalFrames, isAudio)
|
||||
|
||||
@@ -626,7 +626,7 @@ const VideoViewer = React.forwardRef<MediaController, FileViewerProps>(
|
||||
{/* Hidden VideoJS container */}
|
||||
<div ref={videoContainerRef} className="absolute inset-0 z-[-1]" />
|
||||
|
||||
{data.mediaType?.startsWith('audio/') ? (
|
||||
{isAudio ? (
|
||||
<div className="flex flex-col items-center justify-center text-muted-foreground w-full h-full pointer-events-none select-none">
|
||||
<AudioLines
|
||||
className={cn(
|
||||
|
||||
Reference in New Issue
Block a user