Skip to content

Web app: public frontend + local agent (browser-based casting) #7

Description

@gluckdev

Summary

A web version of CastToTV — open a page in any browser (incl. phone) and cast.

Honest browser constraints (why a pure public site can't do it all)

A web page cannot open UDP/SSDP (DLNA discovery), use raw sockets, scan the /24, run ffmpeg/yt-dlp, or SOAP arbitrary IPs (CORS). It can cast a media URL to Chromecast (Google Cast SDK, Chrome/Edge) and to AirPlay (Safari <video>). So the casting/transcoding/discovery has to live in a backend.

Two tiers

Tier 1 — pure public browser (no install):

  • Chromecast via the Cast SDK + Safari AirPlay; "paste a URL → cast" only.
  • No DLNA, no discovery, no transcode, no yt-dlp, no multi-room.

Tier 2 — public frontend + local agent (full features, recommended):

  • The headless CastingController (#) runs as a small local daemon (FastAPI + WebSocket) on the user's PC / Raspberry Pi / home server.
  • The hosted single-page app pairs with that agent over the LAN (or a relay) and drives discovery + DLNA/Chromecast/AirPlay + multi-room + radio/cover-art through it.
  • Reuses the existing media servers as-is (HTTPServerThread :8766, the streamer servers :8768).
  • This is the Jellyfin / Home Assistant model wearing a public URL: the site is public, the casting happens on the user's network via the agent.

Scope

  • FastAPI + WebSocket wrapper around CastingController (depends on #).
  • SPA frontend: device list (protocol-tagged), source input (file upload / URL / radio), cast / multi-room / pause / seek / stop, live now-playing.
  • Pairing flow for the local agent; graceful "Tier 1 only" mode when no agent is present.
  • Honest UI messaging about what each tier supports.

Acceptance

  • With the local agent running, the web UI discovers and casts to DLNA/Chromecast/AirPlay incl. multi-room and radio.
  • Without an agent, the browser can still cast a URL to Chromecast/AirPlay.

Depends on the headless CastingController foundation (#).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions