Video multiplayer — a JS snippet to sync video play-pause state
Backed by syncronization server at zahrevsky.com
Video multiplayer helps you watch a movie together remotely without screen-sharing. Each user opens the same web page with a video and inserts a JS snippet in the developer console. Now, when one user toggles play-pause, it toggles for everyone.
Note This is a proof-of-concept pet-project rather than a finished user-friendly product.
How to use
1. Open web page with the video you are going to watch
2. Insert code from client/snippet.js
into DevTools console
Under the hood
When snippet.js
code is inserted, it:
1. Identifies a video on a page and hooks to it
2. Establishes websocket connection with the server
Now, each time client toggles play-pause, the following transaction happens:
1. Client sends websocket message to the server
2. On receiving this message, server broadcasts another web-socket message to all connected clients
3. Each connected client toggles play-pause on receiving websocket message from server