Enumeration SpaceEvent

Events are how spaces give you state updates. You can listen to these events and update your application state accordingly.

Here is how to listen for space events:

space.on(SpaceEvent.ParticipantJoined, (participant) => {})

Learn more about using events here

These are the events emitted by a Space:

Enumeration Members

ActiveSpeakersChanged: "ActiveSpeakersChanged"

When the active speakers in the space has changed and contains all of the current active speakers and their speaking track

args: (Array<ActiveSpeaker>)

BroadcastStateChanged: "BroadcastStateChanged"

When the broadcast state of the space has changed. This is triggered when a broadcast is either started or stopped. True means the space is being broadcast while false means the broadcast has stopped.

args: (boolean)

LocalParticipantReconnectFailed: "LocalParticipantReconnectFailed"

When the connection to the server has broken, and attempts at a reconnect to the server have failed.

args: (DisconnectedError)

LocalParticipantReconnected: "LocalParticipantReconnected"

When the local participant reconnects to the space

args: (LocalParticipant)

LocalParticipantReconnecting: "LocalParticipantReconnecting"

When the connection to the server has broken, and the Space is attempting to reconnect.

args: ()

ParticipantCustomEventPublished: "ParticipantCustomEventPublished"

When a participant has published a custom event. This is triggered when a participant publishes an event to the space.

The first argument is the participant who published the event.

args: (RemoteParticipant | LocalParticipant, CustomEvent)

ParticipantDisplayNameChanged: "ParticipantDisplayNameChanged"

When a participant's display name has changed.

args: (RemoteParticipant)

ParticipantJoined: "ParticipantJoined"

When a new remote participant has joined the space

args: (RemoteParticipant)

ParticipantLeft: "ParticipantLeft"

When a remote participant has left the space

args: (RemoteParticipant)

ParticipantTrackMuted: "ParticipantTrackMuted"

When a remote participant mutes a track

args: (RemoteParticipant, RemoteTrack)

ParticipantTrackPublished: "ParticipantTrackPublished"

When a remote partcipant has published a new track to the space.

Note: This does not mean you are recieving media yet see

args: (RemoteParticipant, RemoteTrack)

ParticipantTrackSubscribed: "ParticipantTrackSubscribed"

When you have subscribed to a remote participant's track. This means that you have begun receiving media from the associated participant track

args: (RemoteParticipant, RemoteTrack)

ParticipantTrackUnmuted: "ParticipantTrackUnmuted"

When a remote participant unmutes a track

args: (RemoteParticipant, RemoteTrack)

ParticipantTrackUnpublished: "ParticipantTrackUnpublished"

When a participant stops sending a media track. This is triggered when a remote participant stops publishing a track or a remote participant leaves the space.

args: (RemoteParticipant, RemoteTrack)

ParticipantTrackUnsubscribed: "ParticipantTrackUnsubscribed"

When you have stopped receiving media from a remote participant's track. This is triggered when a remote participant stops publishing a track or a remote participant leaves the space.

args: (RemoteParticipant, RemoteTrack)

Generated using TypeDoc