Repository navigation
Packet mumcord watch
Part of the Plugin data protocol. Flow: Flow-Watch-Party.
Purpose. A YouTube watch party in the user's channel. Every participant plays the video in their own embedded player; only playback commands and the shared playlist travel.
dataID |
mumcord.watch |
| Encoding | JSON object |
| Version sent / accepted |
2 / 1 and higher |
| Sent to | Mumcord users in the sender's own channel who announced watch-party
|
| Defined in |
crates/engine/src/watch_party.rs, watch_party/playlist.rs
|
Receivers ignore messages from anyone who is not in their own channel, and commands and playlist edits from people who have not joined.
JSON object with v and a type t. Positions are milliseconds into the video. Video ids must be exactly 11 characters of A-Z, a-z, 0-9, - and _ (a YouTube video id); anything else is dropped.
t |
Fields | Meaning |
|---|---|---|
start |
video |
The sender started a party for this video, paused at the start. |
join |
none | The sender joined the party. |
leave |
none | The sender left the party. |
cmd |
cmd: {"kind":"play"|"pause"|"seek","position_ms":<u32>}
|
A playback command. |
state |
video, playing, pos, starter, members, last, cur, skip
|
The full party, for someone who came into the channel later. Sent twice, about 3 seconds apart. |
pl |
ops: array of playlist edits |
Playlist edits, bundled (version 2). |
next |
from, id, video, skip
|
The sender went on from entry from to entry id playing video; skip is true when skipped instead of ended (version 2). |
state fields: video (id), playing (boolean), pos (u32 ms), starter (session), members (sessions that joined, at most 32 are tracked and the list is checked against the people in the channel), last (optional {"by":<session>,"cmd":{...}}, who did what last), cur (entry id of the current video, 0 for the video the party started with; version 2), skip (optional session of who skipped to it; version 2).
o is the operation, c a Lamport clock, k a sort key; entries are ordered by k, ties broken by id.
o |
Fields | Meaning |
|---|---|---|
add |
id, v (video id), k, c, optional by
|
Adds an entry. by names who added it when that is not the sender. |
rm |
id |
Removes an entry for good; a later add or move of that id is ignored. |
mv |
id, k, c
|
Moves an entry; of two moves the higher c wins. |
{"v":2,"t":"start","video":"abcDEF12345"}
{"v":2,"t":"cmd","cmd":{"kind":"pause","position_ms":61500}}
{"v":2,"t":"state","video":"abcDEF12345","playing":true,"pos":61500,"starter":12,"members":[12,15],"last":{"by":15,"cmd":{"kind":"play","position_ms":61500}},"cur":0}
{"v":2,"t":"pl","ops":[{"o":"add","id":3141592,"v":"ghiJKL67890","k":1.0,"c":4}]}
{"v":2,"t":"next","from":0,"id":3141592,"video":"ghiJKL67890","skip":false}- Version 1 clients drop
plandnext(unknownt) and ignore the newstatefields. - The playlist holds at most 50 entries (
MAX_ENTRIES). Edits are bundled, split to fit 1000 bytes, and sent at most once per second (FLUSH_INTERVAL). - At most 32 participants are tracked (
MAX_PARTICIPANTS).
Shows which video the channel watches and who joined. Only video ids travel; Mumcord never puts anything but a validated id into a player URL.
Flow-Watch-Party, announced via Packet-mumcord-hello.
Mumcord is licensed under the AGPL-3.0 (versions up to 0.1.1: MIT) · Source code · Website · Website source