Working with Streams
Streams allow users to communicate in real time using audio, video, and desktop sharing inside Stream Rooms.
Each Context can contain any number of Stream Rooms identified by streamRoomId.
Before working with Streams, follow the Getting Started Guide.
Sample code on this page is based on the initial assumptions.
Working with Streams
To work with Streams, use StreamApi, which provides methods used to manage Stream Rooms and real-time media streams.
Creating Stream Rooms
Use createStreamRoom(...) to create a room with selected users, managers, and metadata.
Listing and Reading Stream Rooms
Use listStreamRooms(...) for paged room listing and getStreamRoom(...) to fetch a single room.
Updating and Deleting Stream Rooms
Use updateStreamRoom(...) to overwrite the current room definition, including users, managers, metadata, and version.
Devices and Track Sources
The API lets you inspect local capture sources using:
getAudioDevices()getVideoDevices()getDesktopDevices(...)
Joining a Room and Publishing a Stream
Join the room before creating local streams or subscribing to remote ones. Then create a stream handle, add tracks, and publish it.
If you add or remove tracks after publishing, call updateStream(...).
To stop sending media, call unpublishStream(...).
Receiving Remote Streams
Use listStreams(...) to inspect currently published streams and subscribeToRemoteStreams(...) to receive selected remote tracks.
Incoming tracks are handled through addRemoteStreamListener(...).
To react to room and stream changes, continue with Stream Events.
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.