From fa91ce0382ee5290d849d348e4f5533c3340a142 Mon Sep 17 00:00:00 2001 From: talksik Date: Tue, 24 Mar 2026 07:27:23 -0700 Subject: [PATCH] fix: prefetch media warning This is due to the "audio" and "video" preload having limited support in browsers. --- js/src/hooks/use-prefetch-adjacent-media.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/hooks/use-prefetch-adjacent-media.ts b/js/src/hooks/use-prefetch-adjacent-media.ts index 71c2001..81ff72b 100644 --- a/js/src/hooks/use-prefetch-adjacent-media.ts +++ b/js/src/hooks/use-prefetch-adjacent-media.ts @@ -25,7 +25,6 @@ export function usePrefetchAdjacentMedia( for (const particle of mediaParticles) { const objectId = particle.properties.object_id; - const isAudio = particle.properties.mime_type?.startsWith("audio/"); queryClient .prefetchQuery({ @@ -39,7 +38,7 @@ export function usePrefetchAdjacentMedia( objectId, ]); if (url) { - preload(url, { as: isAudio ? "audio" : "video" }); + preload(url, { as: "fetch", crossOrigin: "anonymous" }); } }); }