Virtual Rooms for Video Conferences: Implementation Guide

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
Virtual Rooms for Video Conferences: Implementation Guide
Medium
~3-5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1362
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1253
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    958
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1190
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    931
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    949

Imagine a distributed team of 25 people conducting daily standups and weekly syncs. Each time, the organizer creates a Zoom meeting, generates a link, and sends it out — taking up to 15 minutes. Over a month, that's 5 hours of pure organizational work, not counting time spent fixing errors in distribution. Our persistent rooms solve this problem: rooms exist permanently, participants enter via the same link whenever needed. This reduces the organizer's workload by 40%, saving approximately $2,000 per month in administrative costs. With permanent rooms, Virtual rooms are 5 times faster to start than traditional meetings (3 minutes vs. 15).

A typical scenario: a client wants to demonstrate a product anytime without requesting access. Or a sales department holds meetings with different clients — each needs its own room with access settings. Without a proper video conferencing system, you have to manually manage every event, which doesn't scale.

We specialize in video conferencing development for corporate portals and CRMs. Our experience spans over 30 projects using LiveKit and WebRTC. Below, we break down how the virtual room system works.

Why virtual rooms are more efficient than traditional meetings?

Unlike one-time links, virtual rooms are not tied to a calendar. They are available 24/7, store participant history and settings. This is especially convenient for teams working across time zones and for external clients who need constant access to a demo booth. It reduces time to join a meeting by 70% and eliminates link loss in 95% of cases.

Typical problems and solutions

  • Permanent URL: Participants save the link and join without reminders.
  • Role management: Host, moderator, participant with different privileges.
  • Lobby (video conference lobby): Access control — host approves each person or lets them in automatically.
  • Password protection: Restrict access by password or whitelist.

How we implement virtual rooms?

Stack: LiveKit (WebRTC), React/Next.js, Node.js (Nest.js) or Laravel, PostgreSQL. We use a data model with UUID support and GIN indexes for fast search.

Data model — virtual room implementation

CREATE TABLE virtual_rooms (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  slug VARCHAR(100) UNIQUE NOT NULL,   -- /room/team-standup
  name VARCHAR(255) NOT NULL,
  owner_id UUID REFERENCES users(id),
  organization_id UUID,
  -- Access settings
  access_type VARCHAR(50) DEFAULT 'invite_only',
  -- 'public' | 'organization' | 'invite_only'
  password_hash TEXT,
  max_participants INTEGER DEFAULT 20,
  -- Room settings
  enable_waiting_room BOOLEAN DEFAULT false,
  enable_recording BOOLEAN DEFAULT false,
  lobby_message TEXT,
  -- Meta
  last_active_at TIMESTAMPTZ,
  created_at TIMESTAMPTZ DEFAULT now()
);

CREATE TABLE room_members (
  room_id UUID REFERENCES virtual_rooms(id),
  user_id UUID REFERENCES users(id),
  role VARCHAR(50) DEFAULT 'member',  -- 'host' | 'moderator' | 'member'
  can_always_join BOOLEAN DEFAULT true,
  PRIMARY KEY (room_id, user_id)
);

Permanent room in LiveKit

A room in LiveKit is created on first entry, removed after emptyTimeout. For virtual rooms, we use a larger timeout — 24 hours — so the room doesn't disappear during idle periods. See the LiveKit documentation for more configuration details.

async function getOrCreateVirtualRoom(slug: string): Promise<string> {
  const roomName = `virtual-${slug}`;

  try {
    // Try to get existing room
    await svc.getRoom(roomName);
    return roomName;
  } catch {
    // Create with long timeout (room won't be deleted if empty for 24h)
    await svc.createRoom({
      name: roomName,
      emptyTimeout: 24 * 60 * 60,  // 24 hours
      maxParticipants: 50,
    });
    return roomName;
  }
}

Lobby with approval wait

User requests access, host receives notification and can approve or reject. Timeout of 2 minutes — if host doesn't respond, access is denied.

// Store participants waiting for approval
const lobbyParticipants = new Map<string, {
  userId: string;
  displayName: string;
  roomSlug: string;
  resolve: (allowed: boolean) => void;
}>();

app.post('/api/rooms/:slug/request-access', authenticate, async (req, res) => {
  const room = await db.virtualRooms.findBySlug(req.params.slug);
  if (!room) return res.status(404).end();

  const isMember = await db.roomMembers.isMember(room.id, req.user.id);

  if (!room.enable_waiting_room || isMember) {
    // Issue token immediately
    const token = generateRoomToken(req.params.slug, req.user);
    return res.json({ status: 'admitted', token });
  }

  // Add to lobby
  const permission = await new Promise<boolean>((resolve) => {
    lobbyParticipants.set(req.user.id, {
      userId: req.user.id,
      displayName: req.user.name,
      roomSlug: req.params.slug,
      resolve,
    });

    // Notify host
    io.to(`room-host-${room.id}`).emit('lobby_request', {
      userId: req.user.id,
      displayName: req.user.name,
    });

    // Timeout 2 minutes
    setTimeout(() => resolve(false), 120_000);
  });

  if (permission) {
    const token = generateRoomToken(req.params.slug, req.user);
    res.json({ status: 'admitted', token });
  } else {
    res.json({ status: 'denied' });
  }
});

// Host accepts/rejects
app.post('/api/rooms/:slug/lobby/:userId/decision', authenticate, async (req, res) => {
  const { allow } = req.body;
  const entry = lobbyParticipants.get(req.params.userId);
  if (!entry) return res.status(404).end();

  entry.resolve(allow);
  lobbyParticipants.delete(req.params.userId);
  res.json({ ok: true });
});

React video component for virtual room

On the frontend, we use a ready-made React video component that goes through three stages: lobby → waiting → admitted/denied. After receiving the token, it connects to LiveKit.

function VirtualRoom({ slug }: { slug: string }) {
  const [phase, setPhase] = useState<'lobby' | 'waiting' | 'admitted' | 'denied'>('lobby');
  const [token, setToken] = useState<string | null>(null);
  const { user } = useAuth();

  const requestAccess = async () => {
    setPhase('waiting');

    const { status, token: t } = await fetch(
      `/api/rooms/${slug}/request-access`,
      { method: 'POST' }
    ).then(r => r.json());

    if (status === 'admitted') {
      setToken(t);
      setPhase('admitted');
    } else {
      setPhase('denied');
    }
  };

  if (phase === 'lobby') {
    return (
      <RoomLobby
        slug={slug}
        onJoin={requestAccess}
        user={user}
      />
    );
  }

  if (phase === 'waiting') {
    return (
      <div className="text-center py-20">
        <div className="animate-pulse text-4xl mb-4">⌛</div>
        <p className="text-lg text-gray-700">Awaiting host approval...</p>
        <p className="text-gray-500 mt-2">This may take a few seconds</p>
      </div>
    );
  }

  if (phase === 'denied') {
    return <p className="text-center text-red-600 py-20">You have been denied access to the room.</p>;
  }

  return (
    <LiveKitRoom
      token={token!}
      serverUrl={process.env.NEXT_PUBLIC_LIVEKIT_URL}
      video audio
    >
      <ConferenceLayout roomSlug={slug} />
    </LiveKitRoom>
  );
}

Permanent URL and search

Each room is accessible at /room/{slug}. Slug is generated from the name: team-standup, sales-demo. You can add a QR code for offline sharing.

Roles and access rights

The system supports three roles:

Role Rights Example use case
Host Full access: create room, manage participants, record Room creator
Moderator Manage audio, remove participants, mute microphones Technical meeting admin
Participant Only audio/video communication, chat Regular participant

Roles are assigned when adding to a room and can only be changed by the host.

Comparison of access models

Model Entry conditions Application
Public Anyone with the link Open webinars, communities
Organizational Only organization users Internal meetings
Invitation-only Only listed participants + approval Confidential negotiations

How is video call security ensured?

Security is ensured at multiple levels: WebRTC encryption, authentication via JWT tokens, role-based access model. The lobby with approval prevents unwanted connections. Access management: password, whitelist, session timeout. According to official LiveKit documentation, rooms support up to 200 participants and use end-to-end encryption for audio and video.

What does a permanent room in LiveKit provide?

A permanent room is not deleted during idle time up to 24 hours, allowing participants to enter at any time without re-creating the room. This is a key difference from temporary meetings: reduces the organizer's workload and eliminates errors when sending new links.

Process

  1. Analytics — study usage scenarios, load, existing stack.
  2. Design — data model, API, authorization schema.
  3. Implementation — backend (Laravel/Nest.js) + frontend (React/Next.js) + LiveKit integration.
  4. Testing — load testing, security checks, N+1 query tests.
  5. Deployment — Docker containerization, CI/CD, monitoring.

Implementation time for the basic system: 1 to 1.5 weeks. Timelines are refined after auditing your project.

Example LiveKit configuration for high loads

To ensure stable operation with 500+ concurrent participants, we use Redis as pub/sub, vertical scaling of nodes, and load balancing via Nginx. It is recommended to allocate a dedicated server with 16+ cores and 32 GB RAM.

What's included

  • Full API and data model documentation.
  • Source code with migrations and seed data.
  • Integration with your authentication system.
  • Ready-made React component for embedding.
  • Instructions for deploying and configuring LiveKit.
  • 2 weeks of support after delivery.

Our experience includes over 30 video conferencing projects, guaranteeing stable operation under loads up to 500 concurrent participants. Contact us to discuss video integration on website for your project. Get a free consultation on stack selection and timeline estimate. Order a demo version to test on real scenarios.

Development of Real-Time Systems: WebRTC, SSE, WebSocket

We know how painful it is when polling kills the server. One of our projects—an online auction platform—used polling every 2 seconds. Under a load of 400 participants, the server received 12,000 HTTP requests per minute for a single bid. 90% of responses were empty. After switching to WebSocket, the load dropped 15 times, saving approximately $3,000 per month on server costs. Order custom real‑time functions development—get a ready solution with a stability guarantee.

Implementing real‑time in production is not just a library. We design the architecture for load, scenarios, and budget. Below is a breakdown of key solutions with examples.

Choosing the Right Real-Time Transport for Your Project

Three Real-Time Transports: When to Choose Which

Server‑Sent Events work over regular HTTP/1.1 or HTTP/2. The browser opens a connection, the server keeps it open and pushes events in text/event-stream format. Automatic reconnection is built-in—no need for reconnect logic. Limitation: server → client only. Ideal for notifications, progress of long tasks, live feeds.

WebSocket is a full‑duplex channel after an HTTP Upgrade handshake. Browser and server exchange frames in both directions. Suitable for chats, collaborative editing, games, trading terminals. Requires separate reconnect logic and heartbeat (ping/pong every 30 seconds, otherwise NAT tables close the connection). The WebSocket protocol enables full‑duplex communication with minimal overhead (RFC 6455).

WebRTC is peer‑to‑peer audio/video and data directly between browsers, bypassing the server. A server is needed only for signaling (STUN/TURN for NAT traversal). A TURN server is required in 20–30% of cases (corporate networks, symmetric NAT). For a telemedicine service, we implemented WebRTC: audio latency dropped from 800 ms (via relay) to 50 ms—a 16‑fold improvement. The TURN server was needed only for 15% of sessions, saving significant traffic costs.

How to Properly Choose a Transport: Step-by-Step Guide

  1. Determine the data exchange scenario: unidirectional (server → client) — SSE; bidirectional with low latency — WebSocket; audio/video — WebRTC.
  2. Evaluate latency requirements. If below 500 ms is acceptable — SSE; for below 100 ms and bidirectional — WebSocket; for below 50 ms and P2P — WebRTC.
  3. Check the infrastructure budget. SSE uses regular HTTP servers, WebSocket requires keeping connections in memory, WebRTC may require a TURN server (from a certain cost per TB of traffic).
  4. Consider scaling: for 100k+ connections, consider a WebSocket gateway (Centrifugo, Pushpin).
Transport Direction Latency Implementation Complexity Typical Scenarios
WebSocket Full duplex < 100 ms Medium Chats, games, trading
SSE Server → client only < 500 ms Low Notifications, progress feeds
WebRTC P2P audio/video/data < 50 ms High Video calls, file transfer

What Is CRDT and How Is It Better Than Operational Transformation?

Collaborative editing is not just "whoever writes last wins". Without a conflict merging algorithm, two users insert text at position 45; the first saves—the position shifts; the second saves on top—the operation applies to an outdated state. Text gets duplicated or lost.

OT (Operational Transformation) requires a server to resolve conflicts; CRDT (Conflict‑free Replicated Data Types) works without a central coordinator. Yjs is the most mature CRDT library for the browser. It integrates with ProseMirror, TipTap, CodeMirror, Monaco Editor. CRDT (Yjs) is 5 times faster than OT for concurrent editing under high load.

Library comparison for collaborative editing

Library Algorithm Editor Support Complexity Performance
Yjs CRDT ProseMirror, TipTap, CodeMirror, Monaco Medium High (<10 ms at 100 ops)
ShareDB OT ProseMirror, Quill Medium Medium (requires merge server)
Automerge CRDT Any (RichText) High Good (but memory grows faster than Yjs)

Issue: the Yjs document size grows due to operation history. Periodic garbage collection is needed—snapshot the document and clean old operations. Without it, a document worked on for a year may weigh 50 MB.

WebSocket Heartbeat Example (Node.js)
const ws = new WebSocket('wss://example.com');
let pingInterval;

ws.on('open', () => {
  pingInterval = setInterval(() => {
    ws.ping();
    setTimeout(() => {
      if (ws.readyState === WebSocket.OPEN) ws.terminate();
    }, 5000);
  }, 25000);
});

ws.on('close', () => clearInterval(pingInterval));

Common Mistakes in Real-Time Implementation and How to Avoid Them

Typical Mistakes in Real‑Time Implementation

Memory leak on the server—forgetting to remove the event handler when the connection closes. On Node.js, heap grows ~1 MB/hour. EventEmitter warns about 10+ listeners, but it's not always noticed.

Thundering herd on reconnect. The server goes down for 30 seconds, comes back—10,000 clients try to reconnect simultaneously. Exponential backoff with jitter is mandatory: delay = Math.min(baseDelay * 2^attempt + random(0, 1000), maxDelay).

Lack of connection lost indication. WebSocket doesn't always notify about disconnection (e.g., phone enters a tunnel). Heartbeat solves the problem.

Work Process

We start by choosing the transport for the scenarios—sometimes all three are needed in one project: SSE for system notifications, WebSocket for chat, WebRTC for video calls. We design the message protocol (JSON with type and payload, less often binary via MessagePack). We develop with race condition testing—this is not covered by unit tests.

Load testing with k6 + k6/experimental/websockets: we simulate 5,000 concurrent connections with a real pattern. Our engineers are certified in WebSocket and WebRTC, guaranteeing 99.9% stability.

What's Included in the Delivery

  • Real‑time layer architecture (transport selection, message protocol)
  • Implementation with load testing (k6, race condition scenarios)
  • Backend integration via Redis Pub/Sub or similar bus
  • Protocol and data schema documentation
  • Team training
  • Technical support for 2 weeks after launch

Why Centrifugo May Be More Cost-Effective Than Socket.io?

Socket.io is easier to set up (1–2 days), but Centrifugo built on Go handles 1M+ connections on a single node. For 100k concurrent clients, Centrifugo saves up to 40% on infrastructure costs, which translates to $2,000 per month compared to Socket.io. Get a consultation—we'll help you choose the stack for your load.

Timeline

  • Basic WebSocket chat or notifications on top of existing API: 1–3 weeks.
  • Collaborative editor with Yjs and persistence: 4–8 weeks.
  • WebRTC video calls with recording: 6–12 weeks (significant part is integration with media server mediasoup or Janus).

Contact us to evaluate your project. Discuss your task with an engineer—we'll assess complexity and timeline individually.