RelayrtcDocs
Get started
Documentation
Get started

Rooms, participants and tracks

Understand resource scope, participant identity and how media moves through a call.

On this page

RelayRTC separates call administration from realtime connections. Your backend creates resources and grants access; browsers join with participant tokens and publish or receive media.

Room

A room belongs to one project environment. Save its ID in your application so everyone joining the same call uses the same resource. Creating a room does not connect a participant or start device capture.

Rooms use created, active, ending, ended and failed states. A room remains a server resource after a browser leaves. See room creation for configuration and limits.

Participant and session

A participant represents an identity inside a room. Issuing a participant token allocates that identity. A session represents its connection to signaling and media services.

Use a separately issued token for each caller. Reconnecting an existing session, renewing its token and issuing a new participant token are different operations. Successful session recovery preserves identity when its runtime state is still available; a new token creates another participant identity.

Your application maps its own users to room membership and decides who may join. An API key's scope does not replace those application authorization checks.

Track

A publication describes a media source other participants can receive:

Track typeSource
audioMicrophone
camera_videoCamera
screen_videoShared display
screen_audioOptional audio captured with the display

Mute pauses a publication while keeping capture open. Disable stops capture and removes the publication. Use the publication's paused state or absence to render the appropriate UI.

Data tracks appear in shared types but are not supported for publishing by the current room runtime. Use messages and custom events for application data.

Publish and subscribe

Publishing sends local media to the SFU. Subscribing receives a remote publication. Attaching a subscribed track to an element still requires a decodable frame and browser playback permission before the user sees or hears it.

React's useMediaTrack manages attachment and playback state. autoSubscribe controls receiving remote publications; it does not enable the camera, microphone or credential renewal.

The media server can select a lower video layer when bandwidth is limited. A quality preference cannot create a higher-resolution source than the publisher captured.

Signaling and media

ServiceResponsibility
REST APIResources, participant tokens and administrative operations.
WebSocket signalingMembership, messages, state updates and media negotiation.
Media service/SFUPublished audio/video and remote subscriptions.
TURNRelays media when the browser cannot connect directly to the media service, or when relay-only policy is selected.

A successful REST request or WebSocket connection does not prove that media connectivity works. Each browser must reach the configured public media addresses.

Leave and end

room.leave() leaves the current browser session. relay.rooms.end(roomId) is a server-side administrative action that ends the room for everyone. Removing a participant is another scoped server operation, not a frontend role change.

Destructive operations can return pending cleanup. Inspect their runtime operation before treating resource cleanup as complete.

Rooms and streaming

A stream is reusable streaming configuration; a broadcast is a run with its own lifecycle and outputs. A room can supply media to a ROOM stream, but the stream is not the room. HLS viewers use playback grants and do not join as RTC participants.

See live streaming for that workflow. For an interactive call, continue with the quickstart.