Visualizer — Application Flowchart
+Clear, staged view of initialization, data loading, and playback sync. Shows the recommended two-stage video loading fix (metadata vs buffering).
+Overview
+The visualizer loads JSON radar data and a video file, synchronizes timestamps, creates p5 sketches, then runs a high-precision animation loop to keep video and radar frames in sync.
+Stage 1 — Initialization
+ App boot & cache check +Stage 2 — Data Loading & Finalization
+ Two-stage video loading (robust) +loadedmetadata → video.duration available → call finalizeSetup() (create p5 sketches, draw static graphs).canplaythrough (or fallback timeout/loadeddata) → stop spinner and hide modal.calculateAndSetOffset() + timestamp normalization before finalizeStage 3 — Playback & Synchronization
+ High-precision sync loop +Legend
+Troubleshooting checklist
+-
+
- loadedmetadata must fire before calling
setData(..., videoPlayer.duration). If graphs are blank, confirm timeline shows duration > 0.
+ - If modal never hides, verify
canplaythroughor fallback timer resolves. Some codecs/browsers don't reliably emit canplaythrough — use a timeout fallback.
+ - On cached reload (IndexedDB) the ordering may differ — ensure both paths run the same Stage A → Stage B sequence. +
- Guard
finalizeSetup()with a flag so it only runs once (prevents double initialization).
+