fix: make home video results playable

This commit is contained in:
2026-05-25 15:17:21 +08:00
parent a82069f26a
commit b2d84dce5c
3 changed files with 20 additions and 3 deletions

View File

@@ -530,8 +530,11 @@ export default function Home() {
objectFit="cover"
previewObjectFit="contain"
className="aspect-video w-full rounded-xl"
videoControls={latestVideo.status === "completed"}
label={latestVideo.model}
meta={`${latestVideo.status} · ${Math.round(latestVideo.progress)}%`}
previewDetail={latestVideo.error || undefined}
emptyText={latestVideo.status === "failed" ? "失败" : undefined}
busy={latestVideo.status === "queued" || latestVideo.status === "in_progress"}
onDelete={() => deleteVideo(latestVideo)}
/>

View File

@@ -33,6 +33,7 @@ type MediaAssetTileProps = {
previewClassName?: string
previewPlacement?: MediaAssetPreviewPlacement
previewMaxWidth?: number
videoControls?: boolean
selected?: boolean
disabled?: boolean
busy?: boolean
@@ -94,6 +95,7 @@ export function MediaAssetTile({
previewClassName = "",
previewPlacement = "auto",
previewMaxWidth = 520,
videoControls = false,
selected = false,
disabled = false,
busy = false,
@@ -122,7 +124,7 @@ export function MediaAssetTile({
}
const media = kind === "video" && src ? (
<video src={src} poster={poster} muted playsInline preload="metadata" className={`h-full w-full ${fit} ${mediaClassName}`} />
<video src={src} poster={poster} muted playsInline controls={videoControls} preload="metadata" className={`h-full w-full ${fit} ${mediaClassName}`} />
) : mediaSrc ? (
<img src={mediaSrc} alt={alt} className={`h-full w-full ${fit} ${mediaClassName}`} />
) : (