Room

class Room @AssistedInject constructor(@Assisted context: Context, engine: RTCEngine, eglBase: EglBase, localParticipantFactory: LocalParticipant.Factory, defaultsManager: DefaultsManager, @Named(value = "dispatcher_default") defaultDispatcher: CoroutineDispatcher, @Named(value = "dispatcher_io") ioDispatcher: CoroutineDispatcher, val audioHandler: AudioHandler, closeableManager: CloseableManager, e2EEManagerFactory: E2EEManager.Factory, communicationWorkaround: CommunicationWorkaround, val audioProcessingController: AudioProcessingController, val lkObjects: LKObjects, networkCallbackManagerFactory: NetworkCallbackManagerFactory, audioDeviceModule: AudioDeviceModule, regionUrlProviderFactory: RegionUrlProvider.Factory, connectionWarmer: ConnectionWarmer) : RTCEngine.Listener, ParticipantListener

Constructors

Link copied to clipboard
@AssistedInject
constructor(@Assisted context: Context, engine: RTCEngine, eglBase: EglBase, localParticipantFactory: LocalParticipant.Factory, defaultsManager: DefaultsManager, @Named(value = "dispatcher_default") defaultDispatcher: CoroutineDispatcher, @Named(value = "dispatcher_io") ioDispatcher: CoroutineDispatcher, audioHandler: AudioHandler, closeableManager: CloseableManager, e2EEManagerFactory: E2EEManager.Factory, communicationWorkaround: CommunicationWorkaround, audioProcessingController: AudioProcessingController, lkObjects: LKObjects, networkCallbackManagerFactory: NetworkCallbackManagerFactory, audioDeviceModule: AudioDeviceModule, regionUrlProviderFactory: RegionUrlProvider.Factory, connectionWarmer: ConnectionWarmer)

Types

Link copied to clipboard
@Serializable
value class Sid(val sid: String)
Link copied to clipboard

Properties

Link copied to clipboard
@FlowObservable
@get:FlowObservable
val activeSpeakers: List<Participant>
Link copied to clipboard

Automatically manage quality of subscribed video tracks, subscribe to the an appropriate resolution based on the size of the video elements that tracks are attached to.

Link copied to clipboard
Link copied to clipboard

audio processing is enabled

Link copied to clipboard

Default options to use when creating an audio track.

Link copied to clipboard

Default options to use when publishing an audio track.

Link copied to clipboard

Dynamically pauses video layers that are not being consumed by any subscribers, significantly reducing publishing CPU and bandwidth usage.

Link copied to clipboard

end-to-end encryption manager

Link copied to clipboard

Options for end-to-end encryption. Must be setup prior to connect.

Link copied to clipboard
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var isRecording: Boolean
Link copied to clipboard

A holder for objects that are used internally within LiveKit.

Link copied to clipboard
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var metadata: String?
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var name: String?
Link copied to clipboard
@FlowObservable
@get:FlowObservable
val remoteParticipants: Map<Participant.Identity, RemoteParticipant>
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var sid: Room.Sid?

The session id of the room.

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

Default options to use when creating a video track.

Link copied to clipboard

Default options to use when publishing a video track.

Functions

Link copied to clipboard
suspend fun connect(url: String, token: String, options: ConnectOptions = ConnectOptions()): Nothing?

Connect to a LiveKit Room.

Link copied to clipboard

Disconnect from the room.

Link copied to clipboard
fun getPublisherRTCStats(callback: RTCStatsCollectorCallback)

Get stats for the publisher peer connection.

Link copied to clipboard
suspend fun getSid(): Room.Sid

Gets the sid of the room.

Link copied to clipboard
fun getSubscriberRTCStats(callback: RTCStatsCollectorCallback)

Get stats for the subscriber peer connection.

Link copied to clipboard

Initialize a TextureViewRenderer for rendering a video from this room.

fun initVideoRenderer(viewRenderer: SurfaceViewRenderer)

Initialize a SurfaceViewRenderer for rendering a video from this room.

Link copied to clipboard
open fun onDataReceived(data: ByteArray, participant: RemoteParticipant)

Received data published by another participant

Link copied to clipboard
open fun onEngineResumed()
Link copied to clipboard
open fun onEngineResuming()
Link copied to clipboard
open fun onSpeakingChanged(participant: Participant)

Fired when the current participant's isSpeaking property changes. (including LocalParticipant)

Link copied to clipboard
open fun onTrackPublished(publication: RemoteTrackPublication, participant: RemoteParticipant)

When a new track is published to room after the local participant has joined.

Link copied to clipboard
suspend fun prepareConnection(url: String, token: String? = null)

prepareConnection should be called as soon as the page is loaded, in order to speed up the connection attempt. This function will

Link copied to clipboard
fun release()

Release all resources held by this object.

Link copied to clipboard

Control muting/unmuting the audio input.

Link copied to clipboard

Copies all the options to the Room object.

Link copied to clipboard

Control muting/unmuting all audio output.