diff --git a/apps/web/app/components/MediaPanel.tsx b/apps/web/app/components/MediaPanel.tsx index b386cc4..9897c13 100644 --- a/apps/web/app/components/MediaPanel.tsx +++ b/apps/web/app/components/MediaPanel.tsx @@ -26,7 +26,7 @@ type SignedUrlResponse = { }; type PreviewUrlState = Record; -type VideoPlaybackVariant = { kind: "original" } | { kind: "video_mp4"; size: 720 }; +type VideoPlaybackVariant = { kind: "original" } | { kind: "video_mp4"; size: number }; type VariantsResponse = Array<{ kind: string; size: number; key: string }>; function startOfDayUtc(iso: string) { @@ -113,10 +113,11 @@ export function MediaPanel(props: { selectedDayIso: string | null }) { | "thumb_med" | "poster" | "video_mp4_720", + sizeOverride?: number, ) { const url = variant === "video_mp4_720" - ? `/api/assets/${assetId}/url?kind=video_mp4&size=720` + ? `/api/assets/${assetId}/url?kind=video_mp4&size=${sizeOverride ?? 720}` : `/api/assets/${assetId}/url?variant=${variant}`; const res = await fetch(url, { cache: "no-store" }); if (!res.ok) throw new Error(`presign_failed:${res.status}`); @@ -145,8 +146,8 @@ export function MediaPanel(props: { selectedDayIso: string | null }) { }); if (picked?.kind === "video_mp4") { - const url = await loadSignedUrl(assetId, "video_mp4_720"); - return { url, variant: { kind: "video_mp4", size: 720 } }; + const url = await loadSignedUrl(assetId, "video_mp4_720", picked.size); + return { url, variant: { kind: "video_mp4", size: picked.size } }; } } catch { // fall through to original