legco_ai_assistant/frontend/src/hooks
Woody 1699a249b0 feat: Phase 3.5 — YouTube → ASR integration with source toggle
- useYouTubeASR.ts: adapted from useVideoASR, captures audio from HTMLAudioElement
  (hls.js → <audio> → AudioContext.createMediaElementSource → ScriptProcessorNode → WebSocket)
  Play/pause events on videoElement; same return shape as useVideoASR
- LTTPage.tsx: Source toggle (Upload/YouTube tabs), YouTubeInput + YouTubeVideoPlayer
  wired with handleExtractSuccess → handleAudioReady → useYouTubeASR
  Full Transcript button hidden for YouTube source; unified asr variable
- QueryInput.tsx: no changes needed (already supports partialText/value from any source)
- Tests: 18 new (11 useYouTubeASR, 7 LTTPage integration)
- 189/189 total pass (zero regressions)
- Updated plan: 3.5 marked Complete, 5/7 sub-phases done
2026-05-09 17:00:32 +08:00
..
useFullTranscript.ts fix: Phase 2 ASR pipeline — 9 bugs resolved, Full Transcript works end-to-end 2026-05-06 18:26:17 +08:00
useVideoASR.ts feat: delta-based ASR transcript — use text field, utterance boundaries, stash on pause 2026-05-07 11:26:19 +08:00
useYouTubeASR.ts feat: Phase 3.5 — YouTube → ASR integration with source toggle 2026-05-09 17:00:32 +08:00