Call

class Call(client: StreamVideo, val type: String, val id: String, val user: User)

The call class gives you access to all call level API calls

Samples

Constructors

Link copied to clipboard
constructor(client: StreamVideo, type: String, id: String, user: User)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Debug(val call: Call)

Properties

Link copied to clipboard

Set a custom InputAudioFilter that will be applied to the audio stream recorded on your device.

Link copied to clipboard

Camera gives you access to the local camera

Link copied to clipboard
val cid: String

The cid is type:id

Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard

This returns the local microphone volume level. The audio volume is a linear value between 0 (no sound) and 1 (maximum volume). This is not a raw output - it is a smoothed-out volume level that gradually goes to the highest measured level and will then gradually over 250ms return back to 0 or next measured value. This value can be used directly in your UI for displaying a volume/speaking indicator for the local participant. Note: Doesn't return any values until the session is established!

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

The call state contains all state such as the participant list, reactions etc

Link copied to clipboard
val statLatencyHistory: MutableStateFlow<List<Int>>

Contains stats history.

Link copied to clipboard
val statsReport: MutableStateFlow<CallStatsReport?>

Contains stats events for observation.

Link copied to clipboard
Link copied to clipboard
val user: User
Link copied to clipboard

Set a custom VideoFilter that will be applied to the video stream coming from your device.

Functions

Link copied to clipboard
suspend fun accept(): Result<AcceptCallResponse>
Link copied to clipboard
suspend fun blockUser(userId: String): Result<BlockUserResponse>
Link copied to clipboard
fun cleanup()
Link copied to clipboard
suspend fun create(memberIds: List<String>? = null, members: List<MemberRequest>? = null, custom: Map<String, Any>? = null, settings: CallSettingsRequest? = null, startsAt: OffsetDateTime? = null, team: String? = null, ring: Boolean = false, notify: Boolean = false): Result<GetOrCreateCallResponse>

Create a call. You can create a call client side, many apps prefer to do this server side though

Link copied to clipboard
suspend fun end(): Result<Unit>

ends the call for yourself as well as other users

Link copied to clipboard
suspend fun fastReconnect()

Fast reconnect to the same SFU with the same participant session.

Link copied to clipboard
fun fireEvent(event: VideoEvent)
Link copied to clipboard
suspend fun get(): Result<GetCallResponse>

Basic crud operations

Link copied to clipboard
suspend fun goLive(startHls: Boolean = false, startRecording: Boolean = false, startTranscription: Boolean = false): Result<GoLiveResponse>
Link copied to clipboard
suspend fun grantPermissions(userId: String, permissions: List<String>): Result<UpdateUserPermissionsResponse>
Link copied to clipboard
Link copied to clipboard
fun hasCapability(vararg capability: OwnCapability): Boolean
Link copied to clipboard
fun initRenderer(videoRenderer: VideoTextureViewRenderer, sessionId: String, trackType: <Error class: unknown class>, onRendered: (VideoTextureViewRenderer) -> Unit = {})

Perhaps it would be nicer to have an interface. Any UI elements that renders video should implement it

Link copied to clipboard
fun isLocalPin(sessionId: String): Boolean
Link copied to clipboard
Link copied to clipboard
fun isServerPin(sessionId: String): Boolean
Link copied to clipboard
Link copied to clipboard
suspend fun join(create: Boolean = false, createOptions: CreateCallOptions? = null, ring: Boolean = false, notify: Boolean = false): Result<RtcSession>
Link copied to clipboard
fun leave()

Leave the call, but don't end it for other users

Link copied to clipboard
suspend fun listRecordings(sessionId: String? = null): Result<ListRecordingsResponse>

List the recordings for this call.

Link copied to clipboard
suspend fun migrate()

Migrate to another SFU.

Link copied to clipboard
suspend fun muteAllUsers(audio: Boolean = true, video: Boolean = false, screenShare: Boolean = false): Result<MuteUsersResponse>
Link copied to clipboard
suspend fun muteUser(userId: String, audio: Boolean = true, video: Boolean = false, screenShare: Boolean = false): Result<MuteUsersResponse>
Link copied to clipboard
suspend fun muteUsers(userIds: List<String>, audio: Boolean = true, video: Boolean = false, screenShare: Boolean = false): Result<MuteUsersResponse>
Link copied to clipboard
suspend fun notify(): Result<GetCallResponse>
Link copied to clipboard
suspend fun pinForEveryone(sessionId: String, userId: String): Result<PinResponse>
Link copied to clipboard
fun processAudioSample(audioSample: JavaAudioDeviceModule.AudioSamples)
Link copied to clipboard
suspend fun queryMembers(filter: Map<String, Any>, sort: List<SortField> = mutableListOf(SortField.Desc("created_at")), limit: Int = 25, prev: String? = null, next: String? = null): Result<QueriedMembers>
Link copied to clipboard
suspend fun reject(reason: RejectReason? = null): Result<RejectCallResponse>
Link copied to clipboard
suspend fun rejoin()

Rejoin a call. Creates a new session and joins as a new participant.

Link copied to clipboard
suspend fun removeMembers(userIds: List<String>): Result<UpdateCallMembersResponse>
Link copied to clipboard
suspend fun requestPermissions(vararg permission: String): Result<Unit>

Permissions

Link copied to clipboard
suspend fun revokePermissions(userId: String, permissions: List<String>): Result<UpdateUserPermissionsResponse>
Link copied to clipboard
suspend fun ring(): Result<GetCallResponse>
Link copied to clipboard
suspend fun sendCustomEvent(data: Map<String, Any>): Result<SendCallEventResponse>
Link copied to clipboard
suspend fun sendReaction(type: String, emoji: String? = null, custom: Map<String, Any>? = null): Result<SendReactionResponse>
Link copied to clipboard
Link copied to clipboard
fun setVisibility(sessionId: String, trackType: <Error class: unknown class>, visible: Boolean)
Link copied to clipboard
suspend fun startHLS(): Result<Any>
Link copied to clipboard
suspend fun startRecording(): Result<Any>
Link copied to clipboard
fun startScreenSharing(mediaProjectionPermissionResultData: Intent)

User needs to have OwnCapability.Screenshare capability in order to start screen sharing.

Link copied to clipboard
suspend fun stopHLS(): Result<Any>
Link copied to clipboard
suspend fun stopLive(): Result<StopLiveResponse>
Link copied to clipboard
suspend fun stopRecording(): Result<Any>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun takeScreenshot(track: VideoTrack): Bitmap?
Link copied to clipboard
Link copied to clipboard
suspend fun unpinForEveryone(sessionId: String, userId: String): Result<UnpinResponse>
Link copied to clipboard
suspend fun update(custom: Map<String, Any>? = null, settingsOverride: CallSettingsRequest? = null, startsAt: OffsetDateTime? = null): Result<UpdateCallResponse>

Update a call

Link copied to clipboard
suspend fun updateMembers(memberRequests: List<MemberRequest>): Result<UpdateCallMembersResponse>