Stream Events
Stream events let your application react to Stream Room lifecycle changes and live media activity.
Types of Events
Stream Room Events
streamRoomCreated / streamRoomUpdated
streamRoomCreated- triggers when a new Stream Room is created in your ContextstreamRoomUpdated- triggers when a Stream Room is updated
data is the full StreamRoom object for both events – an update simply carries the Stream Room's state after the change.
streamRoomDeleted
Triggers when a Stream Room is deleted from your Context.
streamRoomJoined / streamRoomLeft
streamRoomJoined- triggers when a user joins a Stream RoomstreamRoomLeft- triggers when a user leaves a Stream Room
Stream Events
streamPublished
Triggers when a new Stream is published in a Stream Room.
streamUpdated
Triggers when tracks are added, removed, or modified in an already-published Stream.
streamUnpublished
Triggers when a Stream stops being published.
streamSubscribed / streamUnsubscribed
streamSubscribed- triggers when a participant subscribes to Stream feedsstreamUnsubscribed- triggers when a participant unsubscribes from Stream feeds
Handling Stream Events
Sample code on this page is based on the initial assumptions.
Before receiving events, your application has to start an event loop and subscribe to specific events in the given scope. Use Context-level subscriptions for Stream Room lifecycle changes and Stream Room-level subscriptions for real-time activity inside a selected room.
To stop receiving events, unsubscribe using the IDs returned by subscribeFor(...).
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.