inspect_jitsi.sync.monitor module#

monitor_room: follow a Jitsi Meet room synchronously until it is closed.

The blocking counterpart of inspect_jitsi.xmpp.monitor.monitor_conference(), which it wraps.

inspect_jitsi.sync.monitor.monitor_room(conference_url, nick=None, name=None, anonymous_domain=None, muc_domain=None, timeout=60, connect_timeout=10, create=False, stay=False)[source]#

Yield the state of a Jitsi Meet room whenever it changes, until it is closed.

This is what inspect-jitsi monitor prints, one dict per JSON line:

for state in monitor_room("https://meet.example.com/SomeRoomName"):
    print(state["status"], len(state["participants"]))

Each dict has the keys room, participants (a list, in the order they joined) and status (open and attempts). The first one is yielded once connected; the last one has status["open"] false. Reconnecting after a lost connection only increases status["attempts"].

Parameters:
  • conference_url (str) – e.g. "https://meet.example.com/SomeRoomName".

  • nick (str | None) – the MUC nickname to join under. Random if not given.

  • name (str | None) – the display name (XEP-0172) to disclose when joining. No display name is disclosed if not given.

  • anonymous_domain (str | None) – override the XMPP domain used for stream/login. Auto-discovered from the site's /config.js if not given.

  • muc_domain (str | None) – override the MUC component domain. Auto-discovered if not given.

  • timeout (float) – seconds to keep trying to reconnect after the connection is lost, before giving up. 0 disables reconnecting.

  • connect_timeout (float) – seconds to wait for each network step.

  • create (bool) – join the room even if it does not exist, which creates it on deployments that let anyone create rooms. Otherwise a room that does not exist is reported as closed, without joining it.

  • stay (bool) – keep monitoring when nobody else is in the room. Otherwise the room counts as closed - and the monitor leaves it - as soon as the monitor is the only one left in it.

Raises:
  • ValueError – the conference URL cannot be parsed.

  • inspect_jitsi.xmpp.JitsiConnectionError – the first connection failed, or the connection was lost and could not be re-established within timeout seconds.

Return type:

Iterator[dict[str, Any]]