Skip to content

Fix companion: migrate to Netlify backend + add TV pairing#396

Open
test01203 wants to merge 8 commits into
ProdigyV21:mainfrom
test01203:fix/netlify-backend-companion
Open

Fix companion: migrate to Netlify backend + add TV pairing#396
test01203 wants to merge 8 commits into
ProdigyV21:mainfrom
test01203:fix/netlify-backend-companion

Conversation

@test01203

@test01203 test01203 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

The companion web app (PR #377) was merged still pointing at the old Supabase backend, but ARVIO has since migrated to Netlify Functions. This PR fixes that, adds TV pairing support, and adds a Sign In button to the main site nav.

Changes:

  • Replace Supabase JS SDK with direct Netlify Functions API (https://auth.arvio.tv/.netlify/functions)
  • Auth: email + password via /auth-login and /cloud-auth-email — same credentials as the official ARVIO login
  • Account data: account-sync-pull / account-sync-push instead of Supabase tables
  • Session stored in localStorage, no Supabase dependency
  • Remove watch history section (not available in new backend)
  • Add Sign In link to the main site nav (→ /companion/)

TV Pairing:

  • Supports ?code=XXXX-XXXX URL param (from tv-auth-start verification_url)
  • If already signed in → /tv-auth-approve (one click)
  • If not signed in → /tv-auth-complete (login + pair in one step)

- Replace Supabase with Netlify Functions (auth.arvio.tv) — same email/password as ARVIO
- Auth: /auth-login and /cloud-auth-email, session in localStorage
- Data: account-sync-pull/push instead of Supabase tables
- TV pairing: ?code=XXXX-XXXX → /tv-auth-complete (one-step) or /tv-auth-approve
- Add Sign In link to main site nav pointing to /companion/
@test01203 test01203 force-pushed the fix/netlify-backend-companion branch from d4c3b1c to b80732f Compare June 20, 2026 07:02
…ro delay)

- SpeechSubtitleEngine: MediaExtractor reads audio 25s ahead of playback
- MediaCodec decodes to 16kHz mono PCM → Groq whisper-large-v3-turbo
- verbose_json timestamps → TreeMap<timeMs, text> → display on exact frame
- PlayerViewModel: auto-starts engine when AI enabled + stream URL set
- PlayerScreen: Hebrew subtitle overlay with shadow text, 6f zIndex
Settings → General → AI Subtitles:
  - New toggle: Voice Transcription + Translation (speech_transcription_enabled)

Player subtitle menu:
  - New '🎙 Voice (HE)' option at top of language list
  - Toggle via viewModel.toggleSpeechSubtitle()

PlayerViewModel:
  - Reads speech_transcription_enabled from DataStore
  - Auto-starts SpeechSubtitleEngine when stream starts (if enabled + API key set)
  - toggleSpeechSubtitle() for manual control from subtitle menu

PlayerScreen:
  - Overlay: Hebrew subtitle text at bottom with shadow, zIndex 6
  - Collects viewModel.speechSubtitle StateFlow

SpeechSubtitleEngine:
  - MediaExtractor reads audio 25s ahead of playback position
  - MediaCodec decodes to 16kHz mono PCM
  - Groq whisper-large-v3-turbo → text + per-segment timestamps
  - TreeMap<timeMs, Pair<text, endMs>> → display loop every 80ms
  - Result: zero perceptible delay (subtitle ready before audio plays)
@ProdigyV21

ProdigyV21 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Is this still needed? @silentbil already updated the webapp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants