fix(webui): reload video player and reset state when switching assets

This commit is contained in:
yiling
2026-06-16 09:21:56 +08:00
parent 5d778f1b43
commit 7c5f462ba5
2 changed files with 7 additions and 0 deletions
@@ -301,6 +301,7 @@ export function FileViewer({
)}
{isVideo && (
<VideoPlayer
key={file.id}
data={file}
playerRef={videoRef}
onPlay={onPlay}
@@ -256,6 +256,12 @@ function FileViewPage() {
}
}, [parentFolderId, activeFileId, carouselState.folderId])
useEffect(() => {
setCurrentTime(0)
setSelectedCommentId(null)
setAnnotations([])
}, [activeFileId])
if (isLoading && !fileData) {
return <FileDetailSkeleton />
}