Room

class Room @AssistedInject() constructor(@Assisted() context: Context, engine: RTCEngine, eglBase: EglBase, localParticipantFactory: LocalParticipant.Factory, defaultsManager: DefaultsManager, @Named(value = dispatcher_defaultdefaultDispatcher: CoroutineDispatcher, @Named(value = dispatcher_ioioDispatcher: CoroutineDispatcher, audioHandler: AudioHandler, closeableManager: CloseableManager, e2EEManagerFactory: E2EEManager.Factory, communicationWorkaround: CommunicationWorkaround, audioProcessingController: AudioProcessingController, lkObjects: LKObjects, networkCallbackManagerFactory: NetworkCallbackManagerFactory) : RTCEngine.Listener, ParticipantListener

Types

Sid
Link copied to clipboard
@Serializable()
value class Sid(sid: String)
State
Link copied to clipboard
enum State : Enum<Room.State>

Functions

connect
Link copied to clipboard
suspend fun connect(url: String, token: String, options: ConnectOptions = ConnectOptions())
Connect to a LiveKit Room.
disconnect
Link copied to clipboard
fun disconnect()
Disconnect from the room.
getParticipantByIdentity
Link copied to clipboard
fun getParticipantByIdentity(identity: Participant.Identity): Participant?
fun getParticipantByIdentity(identity: String): Participant?
getParticipantBySid
Link copied to clipboard
fun getParticipantBySid(sid: Participant.Sid): Participant?
fun getParticipantBySid(sid: String): Participant?
getPublisherRTCStats
Link copied to clipboard
fun getPublisherRTCStats(callback: RTCStatsCollectorCallback)
Get stats for the publisher peer connection.
getSid
Link copied to clipboard
suspend fun getSid(): Room.Sid
Gets the sid of the room.
getSubscriberRTCStats
Link copied to clipboard
fun getSubscriberRTCStats(callback: RTCStatsCollectorCallback)
Get stats for the subscriber peer connection.
initVideoRenderer
Link copied to clipboard
fun initVideoRenderer(viewRenderer: TextureViewRenderer)
Initialize a TextureViewRenderer for rendering a video from this room.
fun initVideoRenderer(viewRenderer: SurfaceViewRenderer)
Initialize a SurfaceViewRenderer for rendering a video from this room.
onDataReceived
Link copied to clipboard
open fun onDataReceived(data: ByteArray, participant: RemoteParticipant)
Received data published by another participant
onEngineResumed
Link copied to clipboard
open fun onEngineResumed()
onEngineResuming
Link copied to clipboard
open fun onEngineResuming()
onSpeakingChanged
Link copied to clipboard
open fun onSpeakingChanged(participant: Participant)
Fired when the current participant's isSpeaking property changes.
onTrackPublished
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.
release
Link copied to clipboard
fun release()
Release all resources held by this object.

Properties

activeSpeakers
Link copied to clipboard
@FlowObservable()
val activeSpeakers: List<Participant>
adaptiveStream
Link copied to clipboard
var adaptiveStream: Boolean = false
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.
audioHandler
Link copied to clipboard
val audioHandler: AudioHandler
audioProcessingController
Link copied to clipboard
audioProcessorIsEnabled
Link copied to clipboard
var audioProcessorIsEnabled: Boolean = false
audio processing is enabled
audioTrackCaptureDefaults
Link copied to clipboard
var audioTrackCaptureDefaults: LocalAudioTrackOptions
Default options to use when creating an audio track.
audioTrackPublishDefaults
Link copied to clipboard
Default options to use when publishing an audio track.
dynacast
Link copied to clipboard
var dynacast: Boolean
Dynamically pauses video layers that are not being consumed by any subscribers, significantly reducing publishing CPU and bandwidth usage.
e2eeManager
Link copied to clipboard
var e2eeManager: E2EEManager? = null
end-to-end encryption manager
e2eeOptions
Link copied to clipboard
var e2eeOptions: E2EEOptions? = null
Options for end-to-end encryption.
events
Link copied to clipboard
val events: EventListenable<RoomEvent>
isRecording
Link copied to clipboard
@FlowObservable()
var isRecording: Boolean
lkObjects
Link copied to clipboard
val lkObjects: LKObjects
localParticipant
Link copied to clipboard
val localParticipant: LocalParticipant
metadata
Link copied to clipboard
@FlowObservable()
var metadata: String?
name
Link copied to clipboard
@FlowObservable()
var name: String?
remoteParticipants
Link copied to clipboard
@FlowObservable()
val remoteParticipants: Map<Participant.Identity, RemoteParticipant>
sid
Link copied to clipboard
@FlowObservable()
var sid: Room.Sid?
The session id of the room.
state
Link copied to clipboard
@FlowObservable()
var state: Room.State
videoTrackCaptureDefaults
Link copied to clipboard
var videoTrackCaptureDefaults: LocalVideoTrackOptions
Default options to use when creating a video track.
videoTrackPublishDefaults
Link copied to clipboard
Default options to use when publishing a video track.

Sources

SDK source
Link copied to clipboard