MoQ is under active development. APIs and protocols may change between releases.

Skip to content

moq-room

crates.iodocs.rs

The native twin of @moq/room. A room is a path prefix. There is no service and no storage: joining is minting a moq-token rooted at that prefix and dialing the relay. Participants are discovered from the announce stream. Identity is the path before camera.hang / screen.hang.

Each participant publishes {identity}/camera.hang (camera + mic) and {identity}/screen.hang (screenshare; its announce/unannounce is the share lifecycle). Capture and encode stay in moq-video and moq-audio.

bash
cargo add moq-room
rust
use moq_net::{Origin, Path};
use moq_room::{Kind, Room, claims};

let token = key.sign(&claims("meet/demo", "alice")?, None)?;
let origin = Origin::random().produce();
let mut room = Room::new(&origin.consume(), Some(Path::new("alice").to_owned()));
while let Some(event) = room.next().await {
    if event.kind == Kind::Camera {
        // subscribe to event.broadcast
    }
}

The JSON window chat track (using moq-json::window) is moq_room::chat. That is not hang.live's hang/chat.json catalog extension.

Gossip, tickets, and 1:1 Call stay in iroh-live. API: docs.rs/moq-room.

Licensed under MIT or Apache-2.0