Types

Link copied to clipboard
@AssistedFactory
interface Factory
Link copied to clipboard
interface PublishListener

Properties

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var attributes: Map<String, String>

The attributes set on this participant.

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var audioLevel: Float

Changes can be observed by using io.livekit.android.util.flow

Link copied to clipboard
@FlowObservable
@get:FlowObservable
val audioTrackPublications: List<Pair<TrackPublication, Track?>>

Changes can be observed by using io.livekit.android.util.flow

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var connectionQuality: ConnectionQuality

Changes can be observed by using io.livekit.android.util.flow

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var identity: Participant.Identity?

The participant's identity on the server. name should be preferred for UI usecases.

Link copied to clipboard
@FlowObservable
@get:FlowObservable
val isCameraEnabled: Boolean
Link copied to clipboard
@FlowObservable
@get:FlowObservable
val isMicrophoneEnabled: Boolean
Link copied to clipboard
@FlowObservable
@get:FlowObservable
val isScreenShareEnabled: Boolean
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var isSpeaking: Boolean

Changes can be observed by using io.livekit.android.util.flow

Link copied to clipboard
val joinedAt: <Error class: unknown class>?

Timestamp when participant joined room, in milliseconds

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var kind: Participant.Kind

The kind of participant (i.e. a standard client participant, AI agent, etc.)

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var lastSpokeAt: Long?

Timestamp when the participant last started speaking, in milliseconds

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var metadata: String?

The metadata for this participant.

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var name: String?

The participant's name. To be used for user-facing purposes (i.e. when displayed in the UI).

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var participantInfo: <Error class: unknown class>?

Changes can be observed by using io.livekit.android.util.flow

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var permissions: ParticipantPermission?

The permissions for this participant.

Link copied to clipboard
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var state: Participant.State

The participant state.

Link copied to clipboard
@FlowObservable
@get:FlowObservable
var trackPublications: Map<String, TrackPublication>

Maps track sids to their track publications.

Link copied to clipboard
@FlowObservable
@get:FlowObservable
val videoTrackPublications: List<Pair<TrackPublication, Track?>>

Changes can be observed by using io.livekit.android.util.flow

Functions

Link copied to clipboard
fun createAudioTrack(name: String = "", options: LocalAudioTrackOptions = audioTrackCaptureDefaults): LocalAudioTrack

Creates an audio track, recording audio through the microphone with the given options.

Link copied to clipboard
fun createScreencastTrack(name: String = "", mediaProjectionPermissionResultData: Intent, options: LocalVideoTrackOptions = screenShareTrackCaptureDefaults.copy(), videoProcessor: VideoProcessor? = null, onStop: (Track) -> Unit): LocalScreencastVideoTrack

Creates a screencast video track.

Link copied to clipboard
fun createVideoTrack(name: String = "", options: LocalVideoTrackOptions = videoTrackCaptureDefaults.copy(), videoProcessor: VideoProcessor? = null): LocalVideoTrack

Creates a video track, recording video through the camera with the given options.

fun createVideoTrack(name: String = "", capturer: VideoCapturer, options: LocalVideoTrackOptions = videoTrackCaptureDefaults.copy(), videoProcessor: VideoProcessor? = null): LocalVideoTrack

Creates a video track, recording video through the supplied capturer.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Returns the default audio track, or creates one if it doesn't exist.

Link copied to clipboard

Returns the default video track, or creates one if it doesn't exist.

Link copied to clipboard

Retrieves the first track that matches the source, or null

Link copied to clipboard

Retrieves the first track that matches name, or null

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open suspend override fun performRpc(destinationIdentity: Participant.Identity, method: String, payload: String, responseTimeout: Duration): String

Initiate an RPC call to a remote participant

Link copied to clipboard
suspend fun publishAudioTrack(track: LocalAudioTrack, options: AudioTrackPublishOptions = AudioTrackPublishOptions( null, audioTrackPublishDefaults, ).copy(preconnect = defaultsManager.isPrerecording), publishListener: LocalParticipant.PublishListener? = null): Boolean

Publishes an audio track.

Link copied to clipboard
suspend fun publishData(data: ByteArray, reliability: DataPublishReliability = DataPublishReliability.RELIABLE, topic: String? = null, identities: List<Participant.Identity>? = null)

Publish a new data payload to the room. Data will be forwarded to each participant in the room. Each payload must not exceed 15k in size

Link copied to clipboard
suspend fun publishDtmf(code: Int, digit: String)

This suspend function allows you to publish DTMF (Dual-Tone Multi-Frequency) signals within a LiveKit room. The publishDtmf function constructs a SipDTMF message using the provided code and digit, then encapsulates it in a DataPacket before sending it via the engine.

Link copied to clipboard
suspend fun publishVideoTrack(track: LocalVideoTrack, options: VideoTrackPublishOptions = VideoTrackPublishOptions(null, videoTrackPublishDefaults), publishListener: LocalParticipant.PublishListener? = null): Boolean

Publishes an video track.

Link copied to clipboard
open suspend override fun registerRpcMethod(method: String, handler: RpcHandler)

Establishes the participant as a receiver for calls of the specified RPC method. Will overwrite any existing callback for the same method.

Link copied to clipboard
suspend fun setCameraEnabled(enabled: Boolean): Boolean

If set to enabled, creates and publishes a camera video track if not already done, and starts the camera.

Link copied to clipboard
suspend fun setMicrophoneEnabled(enabled: Boolean): Boolean

If set to enabled, creates and publishes a microphone audio track if not already done, and unmutes the mic.

Link copied to clipboard
suspend fun setScreenShareEnabled(enabled: Boolean, screenCaptureParams: ScreenCaptureParams? = null): Boolean

If set to enabled, creates and publishes a screenshare video track.

Link copied to clipboard
fun setTrackSubscriptionPermissions(allParticipantsAllowed: Boolean, participantTrackPermissions: List<ParticipantTrackPermission> = emptyList())

Control who can subscribe to LocalParticipant's published tracks.

Link copied to clipboard
open suspend override fun streamBytes(options: StreamBytesOptions): ByteStreamSender

Start sending a stream of bytes. Call ByteStreamSender.close when finished sending.

Link copied to clipboard
open suspend override fun streamText(options: StreamTextOptions): TextStreamSender

Start sending a stream of text. Call TextStreamSender.close when finished sending.

Link copied to clipboard
fun unpublishTrack(track: Track, stopOnUnpublish: Boolean = true)

Unpublish a track.

Link copied to clipboard
open override fun unregisterRpcMethod(method: String)

Unregisters a previously registered RPC method.

Link copied to clipboard
fun updateAttributes(attributes: Map<String, String>)

Set or update participant attributes. It will make updates only to keys that are present in attributes, and will not override others.

Link copied to clipboard
fun updateMetadata(metadata: String)

Updates the metadata of the local participant. Changes will not be reflected until the server responds confirming the update. Note: this requires CanUpdateOwnMetadata permission encoded in the token.

Link copied to clipboard
fun updateName(name: String)

Updates the name of the local participant. Changes will not be reflected until the server responds confirming the update. Note: this requires CanUpdateOwnMetadata permission encoded in the token.