Streams
Streams provide encrypted real-time audio, video, and screen sharing in Stream Rooms.
Stream Module is a real-time communication tool used for audio, video and screen sharing.
Users create Stream Rooms to organize spaces where designated participants can securely publish and receive live media streams. Active users can join a room, publish their own tracks, subscribe to remote streams, and react to room or stream updates in real time.
Prerequisites
Before working with Streams, you need to have a PrivMX Bridge instance.
To install it, follow our PrivMX quick start guide.
Architecture
Streams are organized inside Stream Rooms. Think of a Stream Room as a secure Module for real-time sessions where authorized users can:
- join and leave the room
- publish local audio, video, and desktop tracks
- subscribe to selected remote streams
- manage room metadata and membership
Each Stream Room has its own set of permissions, managed by assigning users’ public keys to the room. Only users with access to the room can read its encrypted metadata and participate in its real-time session.
The public API of the module is centered around StreamApi, which lets you manage Stream Rooms, prepare local streams, publish tracks, subscribe to remote streams, and handle Stream events.
Stream Rooms and Streams
The main data unit in the Stream module is a StreamRoom, which contains:
publicMeta- decrypted metadata available to PrivMX Bridge-side integrationsprivateMeta- encrypted metadata available only to room members (learn more about public and private metadata in PrivMX)usersandmanagers- lists defining who can access and manage the roompolicy- access policy for the room
Inside a joined Stream Room, users can create and publish live Streams composed of audio, video, or desktop capture tracks.
Real-Time Media Flow
Basic Stream workflow is as follows:
- Create or fetch a Stream Room.
- Join the Stream Room.
- Create a local stream handle.
- Add tracks from available audio, video, or desktop devices.
- Publish the stream.
- List remote streams and subscribe to selected ones.
- Attach a remote track listener to render incoming media.
The module also supports updating published streams, unsubscribing from remote streams, configuring frame handling, and enabling room recording.
Events
The Stream module exposes events for both room lifecycle and media activity, including:
- Stream Room creation, update, and deletion
- users joining and leaving streams
- stream publish, update, and unpublish actions
- remote stream availability changes
This allows you to build interfaces such as live meeting rooms, support sessions, consultations, and collaborative calls.
Using Streams
Learn how to work with Streams in your chosen language:
We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.