fix: prefetch media warning
This is due to the "audio" and "video" preload having limited support in browsers.
This commit is contained in:
@@ -25,7 +25,6 @@ export function usePrefetchAdjacentMedia(
|
|||||||
|
|
||||||
for (const particle of mediaParticles) {
|
for (const particle of mediaParticles) {
|
||||||
const objectId = particle.properties.object_id;
|
const objectId = particle.properties.object_id;
|
||||||
const isAudio = particle.properties.mime_type?.startsWith("audio/");
|
|
||||||
|
|
||||||
queryClient
|
queryClient
|
||||||
.prefetchQuery({
|
.prefetchQuery({
|
||||||
@@ -39,7 +38,7 @@ export function usePrefetchAdjacentMedia(
|
|||||||
objectId,
|
objectId,
|
||||||
]);
|
]);
|
||||||
if (url) {
|
if (url) {
|
||||||
preload(url, { as: isAudio ? "audio" : "video" });
|
preload(url, { as: "fetch", crossOrigin: "anonymous" });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user