How benj4368/cinemate works
Cinemate is a browser extension for synchronizing video playback between people in peer-to-peer rooms. A user creates or joins a room in the popup; the background worker manages membership and PeerJS connections, relays playback and ad state, and sends synchronization commands to the content script, which controls the page’s video and displays room status. Excerpts show these message paths, but omit many worker and content-script handlers, so the graph avoids inferring details of those unseen paths.
Main entry points: worker.js Room worker · popup.js Room popup · content.js Page controller
Components 7
Extension UI
- Room popup
src/popup/popup.js
Room coordination
- Room worker
src/background/worker.js - PeerJS network
- P2P room peers
Playback sync
- Page controller
src/content/content.js - Page video
Other components
- User
Connections 9
- User → Room popup: creates or joins
src/popup/popup.js - Room popup → Room worker: requests room actions
src/popup/popup.js - Room popup → Page controller: probes video
src/popup/popup.js - Room worker → Room popup: updates room state
src/popup/popup.js - Page controller → Room worker: sends playback state
src/content/content.js - Room worker → Page controller: sends sync commands
src/background/worker.js - Page controller → Page video: observes and controls
src/content/content.js - Room worker → PeerJS network: uses connections
src/background/worker.js - PeerJS network → P2P room peers: connects peers