I'm the developer of isLiberty, a free watch-together site. You create a room, send the link, and everyone sees the same moment: pause, seek and source changes happen for everyone at once, with a chat next to the player. You can play YouTube, VK Video and Rutube links, or one of hundreds of live TV channels and radio stations sorted by country. No sign-up, just a nickname.
Here's how the sync works under the hood, because that was the interesting part.
Why
My friends and I live in different cities. Screen sharing in Discord kills quality and sound, and if one person has a slow connection, everyone suffers. "Three, two, one, press play" works for five minutes until someone pauses. The existing tools either didn't support the sources we use or wanted an account and a browser extension.
Architecture in one paragraph
Go backend, PostgreSQL, clients talk to the server over WebSocket. Each browser plays the video itself, straight from the source, so everyone gets their own quality. The server never touches video, it only sends the player state.
One state per room
interface PlaybackState { version: number; // bumps with every command source: Source | null; paused: boolean; position: number; // seconds at updatedAt updatedAt: number; // ms, server clock rate: number; } When someone pauses or seeks, the client sends a command (player.pause {position}). The server checks permissions, bumps version, stamps updatedAt with its own clock and broadcasts the new state. Clients only apply a version newer than the one they have, so a late message never rolls the player back.
Don't trust client clocks
The easy mistake is computing the position from the browser's Date.now(). People's clocks drift by seconds. So all times are server times, and each client estimates its offset with ping/pong:
offset ≈ ((t1 - t0) + (t1 - t2)) / 2 // t0, t2 client; t1 server serverNow = Date.now() + offset expected = paused ? position : position + (serverNow - updatedAt) / 1000 * rate Every few seconds the client compares its player position with expected. Small drift is corrected by nudging playback speed, large drift by a jump.
Laggards and the queue
Every client reports player.status (position and buffering) every 5 seconds. A room can turn on "wait for laggards": if someone is buffering, the server pauses everyone and resumes when they've caught up.
There's a shared queue. When a video ends, every client sends player.ended with the state version; the server counts only the first report and starts the next item. That way the switch happens even if someone's tab is in the background with throttled timers.
Different players
YouTube, VK Video and Rutube are embedded via iframes with their own JS APIs, each with quirks: some report position only about once a second, some seek asynchronously. TV channels and radio are HLS streams with no seeking: everyone just watches the live broadcast.
The TV and radio catalog
The catalog is built from open playlists. A worker checks streams periodically and drops dead ones, and users can report a channel that doesn't play. The home page starts a random channel from the viewer's country.
What's next
It's a solo project, so feedback is very welcome: what breaks, which sources are missing, what's awkward on mobile. Try it at isliberty.org, no sign-up needed.
