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.
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.
05

Where a room runs

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.

06

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