/ concept-collection / commonroom
Sign in
concept-collection / commonroom
commonroom / README.md
59 lines · 2.8 KBPreviewCodeBlameHistoryRaw
1# commonroom
3Serverless group video calls in the browser.
5**Live page:** https://concept-collection.github.io/commonroom/
7Enter your name and a room name — any string you like (no spaces) — and you're
8in. Share the room URL with anyone; everyone who joins the same room is
9connected to everyone else over a full WebRTC mesh, up to 8 people. You enter
10with your microphone and camera **off** and turn them on when you're ready.
12The room has shared settings that anyone can change and that apply to
13everyone — currently the video quality (low / medium / high / auto, medium by
14default). You can also share your screen in place of your camera.
16## How it works
18There is no backend and no room registry. The techniques come from the sibling
19projects [commonview](https://github.com/concept-collection/commonview) (the
20auto-connecting mesh) and
21[commoncall](https://github.com/concept-collection/commoncall) (WebRTC media,
22quality presets, screen share):
24- **Identity** — each browser generates a secp256k1 (BIP340 schnorr) keypair,
25 persisted in localStorage. The x-only public key is the peer ID, and every
26 nostr event is signed with it, so peers can't be impersonated.
27- **Rooms** — the room name is hashed into a nostr topic; knowing the name IS
28 the key. Everyone in the room announces `{peerId, name}` on that topic every
29 few seconds via ephemeral events on public relays; entries expire when
30 announcements stop.
31- **Mesh** — being in the room is the consent: every participant automatically
32 brings up a WebRTC connection with every other participant (deterministic
33 initiator = smaller peer ID; offer/answer/ICE ride per-peer nostr topics).
34 Audio/video flows directly between browsers, with public STUN servers and a
35 free TURN relay as fallback. Rooms are softly capped at 8 — peers already at
36 capacity turn newcomers away.
37- **Muted by default** — camera/mic are requested on entry so unmuting is
38 instant, but tracks start disabled. If you deny access you still join,
39 sending silent/black placeholder tracks; unmuting retries the device and
40 upgrades the track in place (`replaceTrack`, no renegotiation).
41- **Shared settings** — one settings object for the whole room, synced over
42 the per-peer control data channels with per-key last-writer-wins (revision
43 counters; ties resolved by the setter's peer ID). The video-quality presets
44 map to `RTCRtpSender.setParameters` caps that each participant applies to
45 its own outgoing senders.
47## Development
49```sh
50npm install
51npm run dev
52```
54Identity is per-browser-profile (localStorage), so two tabs in the same
55profile are the *same* peer — to try a room with multiple participants, use a
56second browser or a private window.
58`npm run build` type-checks and bundles to `dist/`. Pushes to `main` deploy to
59GitHub Pages via `.github/workflows/deploy.yml`.
moveopenescclose