Skip to Content
FeaturesListening roomsJam synchronization

Jam synchronization

How the Jam queue, playback clock, output selection, and concurrent commands work.

From local playback to a room

Starting a Jam captures the host's active playback selection and seeds a separate room queue. The backend stores the room, invite and membership in SQLite. The Jam tracks the current queue entry, playback position, play or pause state, repeat mode, and selected outputs. A repeated song can appear as separate queue entries.

How an output follows the room

  1. A participating browser reports its presence and reads the room state. The host can select it once it appears under Audio outputs.
  2. The browser uses the room's current entry and position to start its local media element. Selected outputs stream through the Jam audio route for the same track. A device can participate in the shared controls with its audio output deselected.
  3. The browser receives updated room state as it polls. It can reuse its queue when its queue epoch and version still match the server.
  4. An explicit seek changes the seek revision so selected players apply the new position. For ordinary drift, the browser uses a small playback-rate adjustment when conditions permit. It avoids repeatedly seeking a stream while it is buffering.

Playback can start at different times

Each browser buffers audio separately and follows its own autoplay policy. Give a blocked browser a click or tap. Expect small differences while devices load or recover.

What happens when two people act

The backend checks membership and applies commands inside a database transaction. Every command carries a command ID so a retry can be recognized. Queue edits and other revision-sensitive actions also carry the room revision. A conflict means someone changed the room first. The player can refresh the state before applying another edit.

ActionWho can perform it
Play, pause, seek, change tracks, and edit the shared queueHost and active participants through the shared player
Select connected audio outputs and toggle multiple-output modeHost
Remove participants or change the inviteHost
Leave the roomIndividual participant
End the entire roomHost

Leaving and recovery

A removed participant loses room access and their output is detached. When the host ends the Jam, the backend revokes the invite and closes the room. After an output drops offline, check its presence and playback state in the host's dialog. For access problems, see Participant management.

Read the Jam state implementation

On this page