From d7c13ecc19a49db4e5a07272642299ab6d5dacfb Mon Sep 17 00:00:00 2001 From: ergosteur <1992147+ergosteur@users.noreply.github.com> Date: Sat, 7 Mar 2026 02:30:46 -0500 Subject: [PATCH] fix: resolve Firefox media warnings by improving video cleanup --- src/App.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 04294e9..ae03cf3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -451,7 +451,9 @@ const VideoThumbnail = ({ url, className }: { url: string; className?: string }) const cleanup = () => { video.removeEventListener('loadedmetadata', handleLoadedMetadata); video.removeEventListener('seeked', handleSeeked); - video.src = ''; video.load(); + // Using removeAttribute is safer than src = '' to stop loading without warnings + video.removeAttribute('src'); + video.load(); }; video.addEventListener('loadedmetadata', handleLoadedMetadata); @@ -485,6 +487,9 @@ const MediaRenderer = ({ file, className, isFullView }: { file: MediaFile; class const sizingClass = isFullView ? "w-full h-auto block" : "w-full h-full object-cover"; const mediaStyle = { transform: 'translateZ(0)' }; + // Guard against empty URLs + if (!file.url) return
; + if (file.type === 'video') { return (