diff --git a/packages/webui/components/file-viewer.tsx b/packages/webui/components/file-viewer.tsx
index 05e40708..f9884e0b 100644
--- a/packages/webui/components/file-viewer.tsx
+++ b/packages/webui/components/file-viewer.tsx
@@ -2,7 +2,7 @@ import { useScreenSize } from '@/ui/hooks/useScreenSize'
import { getBestTranscode } from '@/ui/lib/media'
import type { AssetInfo } from '@shumai/dtos'
import { Check, Copy, Download, Minus, Plus } from 'lucide-react'
-import type { RefObject } from 'react'
+import type { ReactNode, RefObject } from 'react'
import { useEffect, useRef, useState } from 'react'
import type Player from 'video.js/dist/types/player'
import DrawingCanvas from './drawing-canvas'
@@ -18,6 +18,7 @@ type FileViewerProps = {
onPause?: () => void
onTimeUpdate?: (time: number) => void
annotations?: Annotation[]
+ children?: ReactNode
}
export function FileViewer({
@@ -27,6 +28,7 @@ export function FileViewer({
onPause,
onTimeUpdate,
annotations,
+ children,
}: FileViewerProps) {
const { width: screenWidth } = useScreenSize()
const isImage = file.mediaType?.startsWith('image/')
@@ -186,10 +188,28 @@ export function FileViewer({
}
}
- if (!bestUrl) {
+ const isUnsupported = !bestUrl || (!isImage && !isVideo)
+
+ if (isUnsupported) {
return (
-
-
Preview unavailable
+
)
}
@@ -201,26 +221,29 @@ export function FileViewer({
{isImage && (
<>
-
-
+
{/* Zoom Toolbar */}
@@ -278,7 +301,9 @@ export function FileViewer({
onPause={onPause}
onTimeUpdate={onTimeUpdate}
annotations={displayAnnotations}
- />
+ >
+ {children}
+
)}
)
diff --git a/packages/webui/components/viewers/video-player.tsx b/packages/webui/components/viewers/video-player.tsx
index c77b003f..2cf6a31b 100644
--- a/packages/webui/components/viewers/video-player.tsx
+++ b/packages/webui/components/viewers/video-player.tsx
@@ -53,6 +53,7 @@ interface VideoPlayerProps {
onPause?: () => void
onTimeUpdate?: (time: number) => void
annotations?: Annotation[]
+ children?: React.ReactNode
}
type DisplayTranscode = VideoTranscode & { resolution: string }
@@ -310,6 +311,7 @@ const VideoPlayer: React.FC
= ({
onPause,
onTimeUpdate,
annotations,
+ children,
}) => {
const localPlayerRef = useRef(null)
const playerRef = passedPlayerRef || localPlayerRef
@@ -797,49 +799,54 @@ const VideoPlayer: React.FC = ({
onMouseMove={handleMouseMove}
onMouseLeave={handleMouseLeave}
>
- {/* Video Area */}
-
- {/* Hidden VideoJS container */}
-
+
+ {/* Render Carousel/Sidebar here if not fullscreen */}
+ {!state.isFullScreen && children}
- {/* Drawing Canvas (Visible) */}
- {videoHtmlEl && containerSize.width > 0 && (
-
- )}
+ {/* Video Area */}
+
+ {/* Hidden VideoJS container */}
+
- {/* Big Play Button Overlay (when paused) */}
- {!state.isPlaying && !isDrawing && (
-
-
-
+ {/* Drawing Canvas (Visible) */}
+ {videoHtmlEl && containerSize.width > 0 && (
+
+ )}
+
+ {/* Big Play Button Overlay (when paused) */}
+ {!state.isPlaying && !isDrawing && (
+
-
- )}
+ )}
+
- {carouselState.show && (
-
- )}
{isFetching && (
@@ -331,7 +322,17 @@ function FileViewPage() {
onPlay={handlePlay}
onTimeUpdate={setCurrentTime}
annotations={annotations}
- />
+ >
+ {carouselState.show && (
+
+ )}
+
{