Spaces:
Paused
Paused
Commit History
-
feat: one-click watch-party host + click-to-join invite links
Harsh Gupta- Shared links now carry ?room=CODE: a friend who opens it lands straight on the join screen with the code filled (App reads it, Landing opens in join mode, and entering a room reflects it in the URL via history.replaceState). - New "Invite" button in the room header copies the current invite link. - One-click launcher for hosting from your own machine (where torrents actually work): "Start Watch Party.bat" -> WatchParty.ps1 installs/builds on first run, starts the server, opens a free Cloudflare quick-tunnel, prints the public link to share, and opens the app. No terminal commands. - README: lead with the one-click flow; .gitignore the downloaded cloudflared.07ebb0e -
fix: restore peer connectivity, native-first playback, Fly.io config
Harsh GuptaStreaming ("stuck on Connecting to peers"): - Revert the WebTorrent client to its battle-tested defaults. The previous utp:false + custom DHT (an attempt to "optimise for HF") actually REDUCED peer connectivity. Now DHT, trackers, µTP, TCP and web seeds are all on. Playback — native-first (no forced conversion): - Always try to play the raw file via /stream first. Only fall back to the transcoder if the browser actually fails to decode (a decode 'error', or a watchdog: still unplayable after 12s WHILE data is flowing). So MP4 — and H.264 .mkv in Chrome — now play with ZERO conversion; transcoding is a last resort instead of the default for every risky container. Video calls: - Explicitly play() remote tiles (covers autoplay-policy edge cases). Deploy: - Add fly.toml. Fly.io allows the UDP + inbound that real torrenting needs; deploy with `fly launch --copy-config` then `fly deploy`. TURN for calls via fly secrets (TURN_URL/TURN_USERNAME/TURN_CREDENTIAL).511c9c2
-
feat(calls): native WebRTC mesh (drop PeerJS); faster transcode; deploy docs
Harsh GuptaVideo calls — revamped: - Replace PeerJS (self-hosted broker that kept failing on HF) with a native RTCPeerConnection mesh signaled over the existing Socket.IO connection (same transport chat/sync use). One connection per pair, lower socket id offers (no glare), ICE candidates queued until the remote description is set. - Signaling relay now supports directed routing (to a single peer) and stamps `from` server-side. Removes the /peerjs broker, its WS upgrade router, and the peer/peerjs/ws deps (client bundle 378KB -> 289KB). Transcode "stuck on converting" — much lighter: - ultrafast + zerolatency + cap to 720p when re-encoding (HEVC etc.), so it's feasible on weak CPUs; smaller fragment for faster start. (Remux of H.264 stays a fast copy.) Docs: - README: honest deployment guidance (HF/Render/Railway block UDP+inbound and stall real torrents; use a VPS / Oracle free VM / Fly.io / local) and the TURN_URL/TURN_USERNAME/TURN_CREDENTIAL env vars for cross-NAT calls.5bbe0ec -
fix: stop streams/calls breaking — remove regressions, add diagnostics
Harsh GuptaStreaming: - Drop the 12s auto-reload-on-stall: it restarted a slow-but-downloading stream from scratch so it never finished buffering ("stuck on Waiting for data"). - selectFile no longer DESELECTS other files (deselecting can stop the whole download); it only adds a one-time priority selection for the streamed file. - WebTorrent: disable µTP (UDP is blocked on many hosts incl. HF Spaces, so it just wasted connection attempts) — focus on outbound TCP. Bump maxConns. - Buffering overlay now shows live stats (peers · MB/s · MB downloaded) so it's obvious whether data is actually flowing vs. a dead swarm. Video calls: - Stop deleting a participant's tile when ICE reports 'failed' — that happens on every restrictive NAT without TURN and looked like "participants drop". Only remove on real 'closed'/leave; try an ICE restart on failure. - ICE servers are now served by GET /api/ice and configurable via TURN_URL / TURN_USERNAME / TURN_CREDENTIAL env vars, so a real TURN relay c…b93b8e1 -
feat(player): transcode MKV/AVI/HEVC/AC3 to browser-friendly MP4 on the fly
Harsh GuptaBrowser-hostile files (mkv, avi, ts, …) and anything that throws a decode error are now routed through a new /transcode endpoint instead of just warned about. ffmpeg reads the torrent file back through /stream (range-capable, so seeking works), remuxes to fragmented MP4, copies the video when it's already H.264 and transcodes it otherwise, and always outputs AAC stereo audio — so AC3/DTS/HEVC play in any browser. Server: - /transcode/:hash/:idx?start=<s> streams fragmented MP4 via ffmpeg-static. - /probe/:hash/:idx returns duration + codecs (cached) via ffprobe-static. - selectFile + waitForRange prioritise the file; ffmpeg input reconnects on stalls. Client (VideoPlayer): - Risky containers (or a runtime decode error) play via the transcoder. Transcoded segments are 0-based, so the player tracks the segment base offset and treats absolute time = base + currentTime; total duration comes from /probe. - Far seeks / remote sync restart the segment at the new offset; in-buffer seeks …130ea8e -
fix: smooth streaming, call reliability, joiner sync, and many UX bugs
Harsh GuptaStreaming: - Focus download bandwidth on the streamed file (select/deselect) and wait on the real piece bitfield for the requested byte range before piping, so playback resumes on actual data instead of re-stalling. - Position-preserving stall recovery (manual + auto) — the old retry restarted at byte 0 and just re-stalled. - Warn when a container/codec the browser can't decode is selected (mkv/avi/ HEVC) — the usual cause of "audio plays, video frozen". Torrents: - Robust dedup via WebTorrent's own client.get() (handles base32 + reload races) and graceful reuse on "duplicate torrent"; guard undefined files.map. - Default the room's selected file to the first VIDEO, not files[0]. - More public trackers. Rooms / sync: - get-room-state on mount so a joiner lands on the host's playing video instead of the blank paste-magnet page. - Fix leaked sync listeners (stable handler refs), add a seek tolerance, and sync-on-join so newcomers snap to the current position. Video calls…0df6eaa -
fix: self-host PeerJS, repair subtitles/dedup, mobile responsiveness
Harsh GuptaBackend: - Self-host PeerJS signaling at /peerjs (single port, works on HF Spaces). Run its WS server in noServer mode with a path-scoped upgrade router so it no longer aborts Socket.IO's websocket upgrades. Add explicit ws dependency. - Subtitle SRT->VTT conversion now only rewrites timecode commas, not the commas inside dialogue. - await the async WebTorrent v3 client.get() so duplicate-torrent reuse works. - Only append &tr= trackers to magnet URIs (stop corrupting .torrent URLs). - Track the torrent-progress interval per room; clear it on reload/teardown. Frontend: - Re-join the room on socket (re)connect so a reconnect no longer silently drops the user from chat/sync/calls. - Video calls use the self-hosted broker; queue join-call signals received before the local stream is ready; deterministic initiator avoids glare; prune stale tiles on user-left. - Mobile: 100dvh layout, touch-aware player controls with a center play button, viewport-sized sidebar drawer, viewpor…fa460d8 -
Fix duplicate torrent by checking WebTorrent client.get(), improve retry stream
Harsh Guptabaaebfa -
Pre-buffer 5MB before stream, STUN servers for PeerJS, initial buffering state
Harsh Gupta53b86d7 -
Fix PeerJS (cloud broker), sync stream for new joiners, mobile responsive sidebar
Harsh Gupta1de0017 -
Fix PeerJS: integrate into main HTTP server so it works on HF Spaces (single port)
Harsh Guptaaa7e189 -
Initial commit: WatchTorrent - synchronized torrent streaming app
Harsh Gupta500a902