Skip to content

WebRTC & Sync Engine Architecture

Ram Chouhan Full-Stack Engineer edited this page Sep 6, 2026 · 1 revision

🏗️ WebRTC & Sync Engine Architecture

This document provides a technical breakdown of MovieNight's peer-to-peer media pipeline, SDP munging engine, and sub-second drift synchronization.


1. Decentralized Mesh Topology

MovieNight uses a decentralized mesh network:

  • Signaling: Conducted through PeerJS public broker servers to perform ICE candidate gathering and SDP exchange.
  • Data Channels: Reliable RTCDataChannel connections are maintained between all participants for room state, chat messages, and sync heartbeats.
  • Media Tracks: Presenters broadcast SRTP encrypted video and audio streams directly to connected peers.

2. 1080p Stream Quality Pipeline

Standard browser WebRTC drops streaming quality to 360p or 480p to conserve bandwidth. MovieNight prevents this through custom SDP munging: