Realtime (rooms)

Rooms, and the two ways into one.

A room is created by you and joined by anyone you give it to. This page covers creating one, the link form, the embedded form, and the conditions a room can put in front of the door.

01

Create a room

In the console, or over the API with a token that has write scope. A room is created with a name and a size; everything else has a default you can change later.

Create a room
curl -X POST https://dash.yunzheng.space/api/v1/rtc/rooms \
  -H "Authorization: Bearer $ORBIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Weekly sync","max_peers":12,"max_video":4}'

The reply carries the room’s key and, when link access is on, the address to hand out. Both are in the console too — the API is the same room seen from a script.

FieldWhat it sets
nameWhat the room is called. Up to 60 characters.
max_peersHow many people may be in the room at once, from 2 to 50.
max_videoHow many of them may send video. Defaults to 0, which is a voice room.
public_joinWhether the room answers its link at all. Off makes it reachable only through your own service.
passcodeWrite-only. Set it to require one, send an empty string to remove it.
require_verifyWhether a human check runs before admission.
verify_levelstandard, strict or maximum.
cascadeNearest-location routing. On by default for new rooms; see Nearest location.
max_video is separate from max_peers because a camera and a microphone are not the same amount of traffic. A room of ten listeners with two cameras is a different load from a room of ten cameras, and the two numbers let you say which one you meant.
03

In your own page

One script tag, then one call. The library has no dependencies and no build step, and it draws nothing on its own: you get the media streams and place them in your own layout.

Join a room from your own page
<script src="https://rtc.yunzheng.space/v1.js"></script>
<script>
  OrbitRTC.room("<room key>").then(function (room) {
    // room.needs_passcode / room.needs_verify say what to ask for first.
    return OrbitRTC.join({
      room: "<room key>",
      label: "Ada",
      passcode: room.needs_passcode ? prompt("Passcode") : "",
      video: false,
      onTrack: function (stream) {
        var el = document.createElement("audio");
        el.srcObject = stream;
        el.autoplay = true;
        document.body.appendChild(el);
      },
      onError: function (err) { console.error(err.code, err.message); }
    });
  }).then(function (session) {
    window.addEventListener("pagehide", function () { session.leave(); });
  });
</script>

Ask the room what it needs before you render a form, rather than finding out by being refused: OrbitRTC.room() answers with whether a passcode and a human check are required, so the page can put up the right prompt once.

If your pages send a Content-Security-Policy, the library is loaded from https://rtc.yunzheng.space and the room it joins is reached over https: and wss:. A room set to require a human check also loads the verification widget from https://verify.yunzheng.space.
04

Conditions on the door

A room checks its conditions before a participant is admitted, so a refusal costs nothing and reveals nothing about who is inside.

  • A passcode — set on the room, never returned by the API once set. Change it and the old one stops working at once.
  • A human check — at standard, strict or maximum. The level is part of what is checked: a token earned at standard does not satisfy a room set to maximum.
  • No link at all — with link access off, the room address admits nobody, and only the service you built decides who goes in.
Conditions on the doorA room checks its conditions — a passcode, a human check at a named level, or no link access at all — before a participant is admitted, and either lets them in or refuses.Room addresschecked before anyone is admitteda passcodea human check at a named levelor no link access at allIn the roomRefused
The conditions run before anybody is inside, so a refusal costs nothing and tells the person nothing about who is in the room.
05

Nearest location

With nearest-location routing on, each participant connects to the Orbit location nearest them. People in the same region talk through the same location, and a call that spans regions links its locations automatically, so everyone hears and sees everyone else in one room.

It is the cascade setting on a room: on by default for rooms created from now on, and off for rooms created before it existed until you turn it on. Orbit Meet always uses it. A change applies to the next person who joins; nobody already in the room is moved.

Turn it on for an existing room
curl -X PATCH https://dash.yunzheng.space/api/v1/rtc/rooms/$ID \
  -H "Authorization: Bearer $ORBIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"cascade":true}'

A participant who joins from a browser through the room link is placed by where their connection comes from. When your own server asks for a participant’s join, pass near — your server’s location says nothing about theirs. It takes coordinates, or just a country code.

Join a participant who is in Germany
curl -X POST https://dash.yunzheng.space/api/v1/rtc/rooms/$ID/join \
  -H "Authorization: Bearer $ORBIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"label":"Ada","peer_id":"user-4821","near":{"country":"DE"}}'

The reply’s media_host is the location that participant was given. Without near, they join the room’s first location. A value that cannot be read is ignored rather than refused.

06

Where a room runs

With nearest-location routing off, a room runs in one city, and the console names it. The city is fixed on the first join and does not change while people are in the room, because moving a room means dropping everyone in it.

Nothing in a room is recorded. There is no recording to switch on, and no stored copy of what was said or shown.

Where a room runsThree people in one room. Each sends to a single Orbit Server, and that server forwards to the others; nothing travels between the people directly.Orbit Serverthe room runs herePersonPersonPersonEveryone meets on the same machine.
Everyone in a room meets on one machine in one city. Moving it would drop everyone, which is why the city is fixed on the first join.
07

Questions

How many rooms can I have?

As many as the packs on your account allow. The console shows the number, and creating one past it is refused with the limit stated in the reply.

Can a participant be removed?

Not from inside the room today. What you can do is change the passcode or disable the room, both of which take effect on the next admission.

Does the room key expire?

No. It belongs to the room and lasts as long as the room does. Delete the room to retire its address.

Next

Related

Getting started

How an Orbit account is organised, what lives where in the console, and the shortest path from signing in to serving a name from our network.

DNS hosting

Add a zone, point your registrar at our name servers, manage records: weighted answers, health-checked records, ALIAS at the apex, zone-file import.

Connect a hostname

Delegate the whole domain, delegate one hostname, or add a CNAME and leave your DNS where it is. What each one costs you and when to pick it.

← All documentation