fix(webui): load 3d video directly without poster and invert drag rotation to counterclockwise

This commit is contained in:
yiling
2026-10-09 16:23:45 +08:00
parent c5c1b1ee1e
commit 436655b8d4
3 changed files with 13 additions and 8 deletions
@@ -48,8 +48,6 @@ export const ModelViewer = React.forwardRef<MediaController, FileViewerProps>(
const dragStartRef = useRef<{ clientX: number; frame: number }>({ clientX: 0, frame: 0 })
const videoSrc = data.media?.videoPreview?.url || data.media?.videoTranscodes?.[0]?.url || ''
const posterUrl = data.preview?.thumbnailUrl || undefined
const downloadUrl = data.media?.original?.key ? videoSrc : undefined
// Drawing Annotation store
@@ -199,8 +197,9 @@ export const ModelViewer = React.forwardRef<MediaController, FileViewerProps>(
if (!isDraggingRotation) return
const deltaX = e.clientX - dragStartRef.current.clientX
// 12px drag movement corresponds to 1 frame (15°)
// Dragging right (deltaX > 0) rotates turntable counterclockwise (decreasing frame index)
const deltaFrames = Math.round(deltaX / 12)
seekToFrame(dragStartRef.current.frame + deltaFrames)
seekToFrame(dragStartRef.current.frame - deltaFrames)
}
const handleViewerPointerUp = (e: React.PointerEvent<HTMLDivElement>) => {
@@ -301,7 +300,6 @@ export const ModelViewer = React.forwardRef<MediaController, FileViewerProps>(
<video
ref={videoRef}
src={videoSrc}
poster={posterUrl}
playsInline
loop
muted