CallState

class CallState(client: StreamVideo, call: Call, user: User, val scope: CoroutineScope)

The CallState class keeps all state for a call It's available on every call object

Samples

Constructors

Link copied to clipboard
constructor(client: StreamVideo, call: Call, user: User, scope: CoroutineScope)

Properties

Link copied to clipboard
val acceptedBy: StateFlow<Set<String>>
Link copied to clipboard
Link copied to clipboard
val backstage: StateFlow<Boolean>

if we are in backstage mode or not

Link copied to clipboard
val blockedUserIds: StateFlow<List<String>>
Link copied to clipboard
val blockedUsers: StateFlow<Set<String>>
Link copied to clipboard
val broadcasting: StateFlow<Boolean>

if the call is being broadcasted to HLS

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Holds the current closed caption mode for the video call. This object contains information about closed captioning feature availability. This state is updated dynamically based on the server's transcription setting which is io.getstream.android.video.generated.models.TranscriptionSettingsResponse.closedCaptionMode

Link copied to clipboard

Holds the current list of closed captions. This list is updated dynamically and contains at most ClosedCaptionsSettings.maxVisibleCaptions captions.

Link copied to clipboard
val compositeRecording: StateFlow<Boolean>
Link copied to clipboard
Link copied to clipboard
val createdAt: StateFlow<OffsetDateTime?>
Link copied to clipboard
val createdBy: StateFlow<User?>
Link copied to clipboard
val custom: StateFlow<Map<String, Any?>>
Link copied to clipboard
Link copied to clipboard
val duration: StateFlow<Duration?>

how long the call has been running, rounded to seconds, null if the call didn't start yet

Link copied to clipboard
val durationInDateFormat: StateFlow<String?>

how many milliseconds the call has been running in the simple date format.

Link copied to clipboard
val durationInMs: StateFlow<Long?>

how many milliseconds the call has been running, null if the call didn't start yet

Link copied to clipboard
val egress: StateFlow<EgressResponse?>
Link copied to clipboard
val egressPlayListUrl: StateFlow<String?>
Link copied to clipboard
val endedAt: StateFlow<OffsetDateTime?>
Link copied to clipboard
val endedByUser: StateFlow<User?>
Link copied to clipboard
val errors: StateFlow<List<ErrorEvent>>
Link copied to clipboard
Link copied to clipboard
val ingress: StateFlow<Ingress?>
Link copied to clipboard
val isCaptioning: StateFlow<Boolean>

Tracks whether closed captioning is currently active for the call. True if captioning is ongoing, false otherwise.

Link copied to clipboard
val isReconnecting: StateFlow<Boolean>
Link copied to clipboard
val live: StateFlow<Boolean>

the opposite of backstage, if we are live or not

Link copied to clipboard
val liveDuration: StateFlow<Duration?>

How long the call has been live for, represented as Duration, or null if the call hasn't been live yet. Keeps its value when live ends and resets when live starts again.

Link copied to clipboard
val liveDurationInMs: StateFlow<Long?>

How long the call has been live for, in milliseconds, or null if the call hasn't been live yet. Keeps its value when live ends and resets when live starts again.

Link copied to clipboard
Link copied to clipboard

Your own participant state

Link copied to clipboard
val me: StateFlow<ParticipantState?>

Your own participant state

Link copied to clipboard
val members: StateFlow<List<MemberState>>
Link copied to clipboard
Link copied to clipboard
val notificationIdFlow: StateFlow<Int?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Participants in this call, ordered by the active SortPreset. The list emits whenever the order changes — identity-equal emissions are suppressed by the sorter's internal coalescing so consumers don't recompose for non-changes.

Link copied to clipboard
Link copied to clipboard
val pinnedParticipants: StateFlow<Map<SessionId, OffsetDateTime>>

Pinned participants, combined value both from server and local pins.

Link copied to clipboard
val rawRecording: StateFlow<Boolean>
Link copied to clipboard
Link copied to clipboard
val recording: StateFlow<Boolean>
Link copied to clipboard
val rejectActionBundle: StateFlow<Bundle?>
Link copied to clipboard
val rejectedBy: StateFlow<Set<String>>
Link copied to clipboard

Participants other than yourself, in the same sort order as participants. Lazy-initialized to defer resolving _sortedParticipantsState (defined later in this class).

Link copied to clipboard
val ringingState: StateFlow<RingingState>
Link copied to clipboard
val scope: CoroutineScope
Link copied to clipboard
Link copied to clipboard
val session: StateFlow<CallSessionResponse?>
Link copied to clipboard
Link copied to clipboard

Deprecated alias for participants. Return type is intentionally declared as Flow (not StateFlow) to preserve binary compatibility with the pre-existing public API — StateFlow is a Flow, so consumers see the same underlying value.

Link copied to clipboard
val speakingWhileMuted: StateFlow<Boolean>
Link copied to clipboard
val startedAt: StateFlow<OffsetDateTime?>

Will return always null with current SFU implementation - it may be fixed later. For now do not use it.

Link copied to clipboard
val startsAt: StateFlow<OffsetDateTime?>
Link copied to clipboard
Link copied to clipboard
val team: StateFlow<String?>
Link copied to clipboard
val thumbnail: StateFlow<String?>
Link copied to clipboard
val totalParticipants: StateFlow<Int>

a count of the total number of participants.

Link copied to clipboard
val transcribing: StateFlow<Boolean>
Link copied to clipboard
val updatedAt: StateFlow<OffsetDateTime?>

updatedAt

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getOrCreateParticipant(sessionId: String, userId: String, updateFlow: Boolean = false, source: ERROR CLASS: Symbol not found for ParticipantSource = ParticipantSource.PARTICIPANT_SOURCE_WEBRTC_UNSPECIFIED): ParticipantState
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun hasPermission(permission: String): StateFlow<Boolean>

Check if you have permissions to do things like share your audio, video, screen etc

Link copied to clipboard
Link copied to clipboard
fun pin(userId: String, sessionId: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Switch the active sort preset.

Link copied to clipboard
fun unpin(sessionId: String)
Link copied to clipboard
fun updateNotification(notification: Notification)
fun updateNotification(notificationId: Int, notification: Notification)
Link copied to clipboard
Link copied to clipboard

Plug in an ad-hoc Comparator for participant sorting. Overrides the active preset until called again with a different comparator or setSortPreset is invoked.

Link copied to clipboard
fun updateParticipantVisibility(sessionId: String, visibilityOnScreenState: VisibilityOnScreenState)

Update participants visibility on the UI.

Link copied to clipboard

Set a flow to update the participants visibility. The flow should emit lists with currently visible participant session IDs.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard