LocalParticipant

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
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 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 = videoTrackCaptureDefaults.copy(), videoProcessor: VideoProcessor? = null): 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

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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun publishAudioTrack(track: LocalAudioTrack, options: AudioTrackPublishOptions = AudioTrackPublishOptions( null, audioTrackPublishDefaults, ), publishListener: LocalParticipant.PublishListener? = null)

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 publishVideoTrack(track: LocalVideoTrack, options: VideoTrackPublishOptions = VideoTrackPublishOptions(null, videoTrackPublishDefaults), publishListener: LocalParticipant.PublishListener? = null)

Publishes an video track.

Link copied to clipboard
suspend fun setCameraEnabled(enabled: 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)

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, mediaProjectionPermissionResultData: Intent? = null)

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
fun unpublishTrack(track: Track, stopOnUnpublish: Boolean = true)

Unpublish a track.

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.