import { type ReactElement, useCallback, useEffect, useRef, useState } from 'react' import ReactDOM from 'react-dom/client' import type { MediaController } from '@/ui/components/viewers/types' import VideoPlayer from '@/ui/components/viewers/video/video-viewer' import ModelViewer from '@/ui/components/viewers/model/model-viewer' import { calculateFrameCenterTime } from '@/ui/components/viewers/video/utils' import { useUiStore } from '@/ui/stores/ui' import { uploadFilesWithUppy } from '@/ui/lib/uploader' import { useUploadStore } from '@/ui/stores/upload' import { Toaster } from 'sonner' import { SAMPLE_FRAME_RATE, sampleVideoAsset, containerLongerVideoAsset, longAudioVideoAsset, sampleAudioAsset, sampleTurntableAsset, } from './fixture' /** * Backend-free harness page that mounts the *real* VideoPlayer component with a * fixture AssetInfo pointing at a locally served sample video. No API/router/ * query providers are required for playback, so this isolates the frame-accurate * player logic (useFramePlayer + ProgressBar + video.js) for UI integration tests. * * We force the time readout into "frames" mode so specs can parse the exact * integer frame index the UI is displaying and assert it against the native *