import { MotionRuntime } from '@teleporthq/teleport-shared' /** * Generates the TqScrollVideo wrapper. A Scroll Video is a LEAF widget that * maps scroll progress to VIDEO TIME: the clip is a media-worker "scrub * asset" (all-intra encode) so seeking to any frame is cheap — scrubbing IS * setting currentTime. Inside a TqScrollScene it follows the scene track's * pass (discovered via closest('[data-scene-track]'), pin inferred from the * stage's computed sticky position); standalone it scrubs on its own trip * through the viewport — a LEGACY FALLBACK kept for bare markup that predates * the scene-hosted model (or slipped past it): the editor always inserts the * video inside a scene, because the fallback needs ~two screens of * surrounding content before any scrubbing is possible. windowStart/windowEnd map a slice of that progress to * the whole clip. Pure DOM — no animation library involved; progress math * mirrors the canvas renderer's scroll-video-runtime verbatim. * * Guardrails baked in: prefers-reduced-motion holds the poster (or the final * frame with reducedMotion='end'), all measuring work lives in useEffect so * SSR never touches the DOM, and seeks requested before metadata arrives are * replayed on loadedmetadata. The rendered