import { type ReactElement, useCallback, 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 { calculateFrameCenterTime } from '@/ui/components/viewers/video/utils' import { useUiStore } from '@/ui/stores/ui' import { SAMPLE_FRAME_RATE, sampleVideoAsset, containerLongerVideoAsset, longAudioVideoAsset, sampleAudioAsset, } 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 *