Package-level declarations

Utilities to observe Room events and data flows.

Types

Link copied to clipboard
class DataHandler(val messageFlow: Flow<DataMessage>, send: suspend (payload: ByteArray, options: DataSendOptions) -> Unit)

A state holder for handling data messages.

Link copied to clipboard
data class DataMessage(val topic: String?, val payload: ByteArray, val participant: Participant?)

A representation of a message sent/received through LiveKit.

Link copied to clipboard
data class DataSendOptions(val reliability: DataPublishReliability, val identities: List<Participant.Identity>? = null)
Link copied to clipboard

Standard topics for use with rememberDataMessageHandler

Functions

Link copied to clipboard
fun rememberDataMessageHandler(room: Room, topic: String? = null): DataHandler

Creates a DataHandler that is remembered across recompositions. It listens to the specified topic and emits all the messages through DataHandler.messageFlow. Any messages sent through DataHandler.sendMessage will be sent on the specified topic.

Link copied to clipboard
inline fun <T : U, U> rememberEventSelector(eventListenable: EventListenable<U>): Flow<T>

inline fun <T : RoomEvent> rememberEventSelector(room: Room): Flow<T>
inline fun <T : ParticipantEvent> rememberEventSelector(participant: Participant): Flow<T>
inline fun <T : TrackPublicationEvent> rememberEventSelector(publication: TrackPublication): Flow<T>

A utility method to obtain a flow for specific room events.

inline fun <T : TrackEvent> rememberEventSelector(track: Track): Flow<T>

A utility method to obtain a flow for specific track events.