# Meeting Rooms

### 1. Overview

Streampixel Meeting Rooms enable real-time collaborative viewing experiences where multiple users watch and interact with the same application instance simultaneously. Meeting Rooms are designed for scenarios where one user (the **Host**) runs an application, and other users (**Guests**) join to view and optionally interact through voice or text chat.

Meeting Rooms solve the challenge of synchronized collaborative experiences without requiring multiple application instances or complex state synchronization logic. They are ideal for:

* Live demonstrations and product walkthroughs
* Collaborative design reviews
* Remote training and onboarding sessions
* Real-time customer support

***

### 2. Core Concept: One Stream, Many Viewers

The fundamental principle of Streampixel Meeting Rooms is simple but critical to understand:

**The application runs exactly once, on the Host's side. Guests do not run their own instances.**

This architecture provides several important guarantees:

* **Perfect Synchronization**: All participants see exactly what the Host sees, in real-time
* **Zero State Mismatch**: Since only one instance runs, there is no possibility of state divergence between participants
* **Efficient Resource Usage**: Only one application instance consumes computational resources, regardless of viewer count
* **Simplified Development**: Developers don't need to implement state synchronization or conflict resolution logic

When a Guest joins a Meeting Room, they receive a video stream of the Host's application. The application itself is not running on the Guest's device—they are viewing a live broadcast of the Host's session.

***

### 3. Roles, Permissions, and CCU Accounting

Streampixel Meeting Rooms define two distinct roles with different capabilities and billing implications.

#### 3.1 Host

The Host is the user who runs the application instance and whose session is broadcast to Guests.

**Host Capabilities:**

* Runs the actual application instance
* Has full control over the application (mouse, keyboard, interactions)

**Host CCU Accounting:**

* **The Host counts as 1 CCU (Concurrent User)**
* This is the only CCU charged for the Meeting Room
* Participate in voice chat (if enabled)
* Participate in text chat (if enabled)

#### 3.2 Guests

Guests are viewers who join to watch the Host's session.

**Guest Capabilities:**

* View the Host's application stream in real-time
* Participate in voice chat (if enabled)
* Participate in text chat (if enabled)
* **Cannot control the stream or interact with the application**

**Guest CCU Accounting:**

* **Guests do NOT count as CCU**
* Any number of Guests can join without increasing CCU usage
* Only the Host's CCU is counted for billing purposes

#### 3.3 Permissions and CCU Summary Table

| Role      | Runs Application | Controls Application | Voice Chat     | Text Chat      | CCU Count |
| --------- | ---------------- | -------------------- | -------------- | -------------- | --------- |
| **Host**  | Yes              | Yes                  | Yes (optional) | Yes (optional) | **1 CCU** |
| **Guest** | No               | No                   | Yes (optional) | Yes (optional) | **0 CCU** |

This billing model makes Meeting Rooms extremely cost-effective for scenarios with many viewers, since you only pay for the single Host instance regardless of audience size.

***

### 4. Voice Chat and Text Chat

StreamPixel Meeting Rooms include optional communication features that enable collaboration without affecting stream control. You can know more about this feature at [built-in-voice-and-text-chat](https://docs.streampixel.io/resources/readme/built-in-voice-and-text-chat "mention")

***

### 5. streamerId (Critical Concept)

The `streamerId` is the single most important identifier in Meeting Rooms. Understanding it correctly is essential for proper implementation.

#### 5.1 What is streamerId?

The `streamerId` is a unique identifier that defines a specific Meeting Room. It serves as:

* The **Meeting Room ID** that connects all participants
* The identifier that tells the SFU (Selective Forwarding Unit) which stream to route
* The coordination point that ensures the Host and all Guests join the same session

#### 5.2 Critical Requirements

1. **Uniqueness**: Each Meeting Room must have a unique `streamerId`
2. **Consistency**: The Host and ALL Guests must use the **exact same** `streamerId` to join the same room
3. **Single Host Rule**: Only one Host can connect per `streamerId` at a time

{% hint style="warning" %}
If the Host uses `streamerId: "meeting-123"` but a Guest uses `streamerId: "meeting-456"`, they will be in completely different Meeting Rooms and will not see each other.
{% endhint %}

***

#### 6. Best Practices for Generating streamerId

**Recommended approaches:**

```javascript
// UUIDv4 (recommended for production)
const streamerId = crypto.randomUUID();
// Example: "f47ac10b-58cc-4372-a567-0e02b2c3d479"

// Timestamp + random (good for debugging)
const streamerId = `meeting-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
// Example: "meeting-1638360000000-k2j4h8f3d"

// Custom namespaced ID (good for integration)
const streamerId = `org-${organizationId}-session-${sessionId}`;
// Example: "org-acme-session-42"
```

**Avoid these approaches:**

```javascript
// ❌ BAD: Not unique
const streamerId = "meeting-room";

// ❌ BAD: Predictable sequence
const streamerId = `meeting-${counter++}`;

// ❌ BAD: User-controlled input without validation
const streamerId = userInput; // Could conflict with other meetings
```

{% hint style="warning" %}
The `streamerId` must be generated once and distributed to all participants. Never generate it separately for each participant.
{% endhint %}

***

### 7. All Three Ways to Create Meeting Rooms

Streampixel provides three distinct methods for creating Meeting Rooms. Each has different trade-offs in terms of convenience, control, and responsibility.

#### 7.1 Dashboard-Generated Meeting Rooms (Recommended)

The Streampixel Dashboard provides the easiest and safest way to create Meeting Rooms.

**How it works:**

1. Navigate to your project in the Streampixel Dashboard and click on sharing tab.
2. Click "Create Meeting Room"
3. The Dashboard generates:
   * A Host link with `sfuHost=true`
   * A Guest link with `sfuPlayer=true`
4. Share the appropriate links with participants

**Example generated links:**

```js
Host Link:
https://share.streampixel.io/your-project?streamerId=[streamerId}&sfuHost=true

Guest Link:
https://share.streampixel.io/your-project?streamerId=[streamerId}&sfuPlayer=true
```

**Advantages:**

* **Zero implementation required**: No code needed
* **Automatic streamerId generation**: Guaranteed uniqueness
* **Role enforcement**: Dashboard ensures correct `sfuHost`/`sfuPlayer` settings
* **No conflicts**: Dashboard prevents accidental duplicate Hosts
* **Best for non-developers**: Accessible to anyone with Dashboard access

**When to use:**

* Quick demos or one-off sessions
* Non-technical users creating meeting rooms
* When you want to avoid any implementation errors
* Production scenarios where safety is paramount

#### 7.2 Web SDK–Only Meeting Rooms (No Dashboard)

Developers can create Meeting Rooms programmatically using the StreamPixel Web SDK without using the Dashboard. For more information visit [sfu-streaming](https://docs.streampixel.io/resources/getting-started/features/sfu-streaming "mention")

#### 7.3 Share-URL-Only Meeting Rooms (No Dashboard, No Web SDK)

Meeting Rooms can be created using only the Streampixel share URL with query parameters, requiring neither Dashboard nor SDK integration.

**How it works:**

1. Generate a unique `streamerId`
2. Construct Host URL with `sfuHost=true` parameter
3. Construct Guest URL(s) with `sfuPlayer=true` parameter
4. Share the URLs directly with participants

**Host Link Example:**

```js
https://share.streampixel.io/{projectId}?streamerId={random-streamerId}&sfuHost=true
```

**Guest Link Example:**

```
https://share.streampixel.io/{projectId}?streamerId=SFU_{streamerID-generated}&sfuPlayer=true
```

**URL Parameters:**

| Parameter    | Required        | Values            | Description                 |
| ------------ | --------------- | ----------------- | --------------------------- |
| `streamerId` | Yes             | Any unique string | Meeting Room identifier     |
| `sfuHost`    | Yes (for Host)  | `true`            | Marks this user as the Host |
| `sfuPlayer`  | Yes (for Guest) | `true`            | Marks this user as a Guest  |

**Advantages:**

* **No code required**: Works with just URL construction
* **Simple distribution**: Share links via email, Slack, etc.
* **No SDK dependency**: Users click and join immediately
* **Platform agnostic**: Works from any device with a browser

**Risks and Responsibilities:**

* **Manual streamerId management**: You must ensure uniqueness
* **No automatic enforcement**: Multiple Hosts can accidentally connect
* **Link security**: Anyone with the Host link can become the Host
* **No built-in safeguards**: Easy to make configuration mistakes

**When to use:**

* Quick testing or prototyping
* Internal team meetings where security is not critical
* Simple use cases without custom logic
* When you want minimal technical overhead

***

### 8. Embedding Meeting Rooms

Meeting Room links function identically to standard StreamPixel share links and can be embedded in iframes for integration into existing applications.

#### How Embedding Works

Meeting Room URLs can be embedded in:

* Custom dashboards
* SaaS application portals
* Learning management systems
* Enterprise collaboration tools
* Customer support interfaces

The embedded experience is identical to the standalone experience, with the application running in the iframe context. You can refer to [iframe-integration](https://docs.streampixel.io/resources/iframe-integration "mention") to learn more about how streams could be embedded using Iframe.

***

#### 9. The Most Important Concept

**The `streamerId` is the Meeting Room.** Every participant (Host and all Guests) must use the **exact same `streamerId`** to join the same room. Generate it once, share it with everyone, and ensure uniqueness across all concurrent meetings.
