Events

In most cases you can simply use the Stateflow objects Stream exposes. However for some customizations you’ll want to listen to the underlying events that power these state objects.

Listening to events

Both the call and client object allow you to subscribe to events. You can listen to a specific event or all of them. This example shows how to listen to all events

val sub = client.subscribe { event: VideoEvent ->
    logger.d { event.toString() }
}
// stop listening
sub.dispose()

You can also subscribe to call events.

val call = client.call("default", "123")
val sub = call.subscribe { event: VideoEvent ->
    logger.d { event.toString() }
}
// stop listening
sub.dispose()

Or listen to a specific event.

val sub = client.subscribeFor<ConnectedEvent> { event ->
    logger.d { event.toString() }
}
// stop listening
sub.dispose()

Events

The following events are emitted by the client:

Event NameDescription
BlockedUserEventThis event is sent to call participants to notify when a user is blocked on a call. Clients can use this event to show a notification. If the user is the current user, the client should leave the call screen as well.
CallAcceptedEventThis event is sent when a user accepts a notification to join a call.
CallCreatedEventThis event is sent when a call is created. Clients receiving this event should check if the ringing field is set to true and if so, show the call screen.
CallEndedEventThis event is sent when a call is marked as ended for all its participants. Clients receiving this event should leave the call screen.
CallHLSBroadcastingStartedEventThis event is sent when call HLS broadcasting has started.
CallHLSBroadcastingStoppedEventThis event is sent when call HLS broadcasting has stopped.
CallHLSBroadcastingFailedEventThis event indicates that call HLS broadcasting has failed.
CallLiveStartedEventThis event is sent when a livestream has started.
CallMemberAddedEventThis event is sent when one or more members are added to a call.
CallMemberRemovedEventThis event is sent when one or more members are removed from a call.
CallMemberUpdatedEventThis event is sent when one or more members are updated.
CallMemberUpdatedPermissionEventThis event is sent when one or more members get their role capabilities updated.
CallReactionEventThis event is sent when a reaction is sent in a call, clients should use this to show the reaction in the call screen
CallRecordingStartedEventThis event is sent when call recording has started.
CallRecordingStoppedEventThis event is sent when call recording has stopped.
CallRecordingReadyEventIndicates that a call recording is ready.
CallRecordingFailedEventIndicates that recording a call failed.
CallRejectedEventThis event is sent when a user rejects a notification to join a call.
CallRingEventThis event is sent to all call members to notify they are getting called.
CallSessionStartedEventThis event is sent when a call session starts.
CallSessionEndedEventThis event is sent when a call session ends.
CallSessionParticipantJoinedEventThis event is sent when a participant joins a call session.
CallSessionParticipantLeftEventThis event is sent when a participant leaves a call session.
CallTranscriptionStartedEventThis event indicates that call transcribing has started.
CallTranscriptionStoppedEventIndicates that call transcribing has stopped.
CallTranscriptionReadyEventThis event is sent when call transcriptions are ready.
CallTranscriptionFailedEventIndicates that call transcribing failed.
CallUpdatedEventThis event is sent when a call is updated. Clients should use this update the local state of the call. This event also contains the capabilities by role for the call, clients should update the own_capability for the current.
ConnectedEventThis event is sent when the WS connection is established and authenticated. This event contains the full user object as it is stored on the server.
ConnectionErrorEventThis event is sent when the WS connection attempt fails.
HealthCheckEventPeriodic event used to check the connection health.
PermissionRequestEventThis event is sent when a user requests access to a feature on a call, clients receiving this event should display a permission request to the user.
UnblockedUserEventThis event is sent when a user is unblocked on a call. This can be useful to notify the user that they can now join the call again.
UpdatedCallPermissionsEventThis event is sent to notify about permission changes for a user. Clients receiving this event should update their UI accordingly.
VideoEventThe discriminator object for all websocket events, you should use this to map event payloads to the correct type.
WSCallEventPlaceholder for all call events.
WSClientEventPlaceholder for all client events.
CustomVideoEventA custom event. This event is used to send custom events to other participants in the call.
© Getstream.io, Inc. All Rights Reserved.