Package-level declarations

Composition locals to aid in development of Livekit features.

Properties

Link copied to clipboard

CompositionLocal for the Participant currently provided by ParticipantScope

Link copied to clipboard

CompositionLocal for the Room currently provided by RoomScope

Link copied to clipboard

Not to be confused with LocalParticipant.

Functions

Link copied to clipboard
fun ForEachParticipant(participants: List<Participant>, content: @Composable (Participant) -> Unit)

A simple way to loop over participants that creates a ParticipantScope for each participant and calls content.

Link copied to clipboard

A simple way to loop over tracks that creates a TrackReferenceScope for each track and calls content.

Link copied to clipboard
fun HandleRoomState(state: Room.State, passedRoom: Room? = null, vararg keys: Any, onState: suspend CoroutineScope.(Room, Room.State) -> Unit?)

fun HandleRoomState(states: List<Room.State> = emptyList(), passedRoom: Room? = null, vararg keys: Any, onState: suspend CoroutineScope.(Room, Room.State) -> Unit?)

A simple handler for listening to room state changes.

Link copied to clipboard
fun ParticipantScope(participant: Participant, content: @Composable () -> Unit)
Link copied to clipboard
fun rememberLiveKitRoom(url: String? = null, token: String? = null, audio: Boolean = false, video: Boolean = false, connect: Boolean = true, roomOptions: RoomOptions? = null, liveKitOverrides: LiveKitOverrides? = null, connectOptions: ConnectOptions? = null, onConnected: suspend CoroutineScope.(Room) -> Unit? = null, onDisconnected: suspend CoroutineScope.(Room) -> Unit? = null, onError: (Room, Exception?) -> Unit? = DEFAULT_ERROR_HANDLER, passedRoom: Room? = null, disconnectOnDispose: Boolean = true): Room

Remembers a new Room object.

Link copied to clipboard
fun requireParticipant(passedParticipant: Participant? = null): Participant

Returns the passedParticipant or the currently provided ParticipantLocal.

Link copied to clipboard
fun requireRoom(passedRoom: Room? = null): Room

Returns the passedRoom or the currently provided RoomLocal.

Link copied to clipboard
fun requireSession(session: Session? = null): Session

Returns the session, or if null/no-arg, the currently provided SessionLocal.

Link copied to clipboard

Returns the passedTrack or the currently provided TrackReferenceLocal.

Link copied to clipboard
fun RoomScope(url: String? = null, token: String? = null, audio: Boolean = false, video: Boolean = false, connect: Boolean = true, roomOptions: RoomOptions? = null, liveKitOverrides: LiveKitOverrides? = null, connectOptions: ConnectOptions? = null, onConnected: suspend CoroutineScope.(Room) -> Unit? = null, onDisconnected: suspend CoroutineScope.(Room) -> Unit? = null, onError: (Room, Exception?) -> Unit? = null, passedRoom: Room? = null, disconnectOnDispose: Boolean = true, content: @Composable (room: Room) -> Unit)

Establishes a room scope which remembers a Room object which can be accessed through the RoomLocal composition local.

Link copied to clipboard
fun SessionScope(session: Session, content: @Composable (session: Session) -> Unit)

Establishes a session scope which allows the current Session that can be accessed through the SessionLocal composition local, as well as the session's room object through the RoomLocal composition local.

Link copied to clipboard

Binds trackRef to the TrackReferenceLocal for the scope of content.