Room class

Room is the primary construct for LiveKit conferences. It contains a group of Participants, each publishing and subscribing to Tracks. Notifies changes to its state via two ways, by assigning a delegate, or using it as a provider. Room will trigger a change notification update when

  • state changes
  • participant membership changes
  • active speakers are different
Inheritance
Mixed-in types
Available extensions

Constructors

Room({@Deprecated('deprecated, please use connectOptions in room.connect()') ConnectOptions connectOptions = const ConnectOptions(), RoomOptions roomOptions = const RoomOptions(), Engine? engine})

Properties

activeSpeakers → UnmodifiableListView<Participant<TrackPublication<Track>>>
a list of participants that are actively speaking, including local participant.
no setter
agentParticipant → RemoteParticipant?

Available on Room, provided by the AgentRoom extension

The first agent participant in the room, if one exists.
no setter
agentParticipants → Iterable<RemoteParticipant>

Available on Room, provided by the AgentRoom extension

All agent participants currently in the room.
no setter
canPlaybackAudio → bool

Available on Room, provided by the RoomHardwareManagementMethods extension

no setter
connectionState → ConnectionState
connection state of the room
no setter
connectOptions → ConnectOptions
no setter
disposeFuncCount → int
no setterinherited
e2eeManager → E2EEManager?
no setter
events → EventsEmitter<RoomEvent>
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isDisposed → bool
no setterinherited
isRecording → bool
no setter
localParticipant → LocalParticipant?
the current participant
no setter
metadata → String?
metadata of the room
no setter
name → String?
name of the room
no setter
remoteParticipants → UnmodifiableMapView<String, RemoteParticipant>
no setter
roomOptions → RoomOptions
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedAudioInputDeviceId → String?

Available on Room, provided by the RoomHardwareManagementMethods extension

Get current audio input device.
no setter
selectedAudioOutputDeviceId → String?

Available on Room, provided by the RoomHardwareManagementMethods extension

Get current audio output device.
no setter
selectedVideoInputDeviceId → String?

Available on Room, provided by the RoomHardwareManagementMethods extension

Get current video input device.
no setter
serverRegion → String?
Server region
no setter
serverVersion → String?
Server version
no setter
speakerOn → bool?

Available on Room, provided by the RoomHardwareManagementMethods extension

Get mobile device's speaker status.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
connect(String url, String token, {ConnectOptions? connectOptions, RoomOptions? roomOptions, FastConnectOptions? fastConnectOptions}) → Future<void>
createListener({bool synchronized = false}) → EventsListener<RoomEvent>
inherited
disconnect() → Future<void>
Disconnects from the room, notifying server of disconnection.
dispose() → Future<bool>
Discards any resources used by the object.
inherited
getParticipantByIdentity(String identity) → Participant<TrackPublication<Track>>?
retrieves a participant by identity
getSid() → Future<String>

Available on Room, provided by the RoomPrivateMethods extension

server assigned unique room id. returns once a sid has been issued by the server.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onDispose(OnDisposeFunc func) → void
inherited
prepareConnection(String url, String? token) → Future<void>
prepareConnection should be called as soon as the page is loaded, in order to speed up the connection attempt. This function will
registerByteStreamHandler(String topic, ByteStreamHandler callback) → void

Available on Room, provided by the DataStreamRoomMethods extension

registerRpcMethod(String method, RpcRequestHandler handler) → void

Available on Room, provided by the RoomRPCMethods extension

Register a handler for incoming RPC requests. @param method, the method name to listen for. When a request with this method name is received, the handler will be called. The handler should return a string payload to send back to the caller. If the handler returns null, an error will be sent back to the caller.
registerTextStreamHandler(String topic, TextStreamHandler callback) → void

Available on Room, provided by the DataStreamRoomMethods extension

removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
sendSimulateScenario({int? speakerUpdate, bool? nodeFailure, bool? migration, bool? serverLeave, bool? switchCandidate, bool? signalReconnect, bool? fullReconnect, int? subscriberBandwidth, bool? disconnectSignalOnResume, bool? disconnectSignalOnResumeNoMessages, bool? leaveRequestFullReconnect}) → Future<void>

Available on Room, provided by the RoomDebugMethods extension

To be used for internal testing purposes only.
setAudioInputDevice(MediaDevice device) → Future<void>

Available on Room, provided by the RoomHardwareManagementMethods extension

Set audio input device.
setAudioOutputDevice(MediaDevice device) → Future<void>

Available on Room, provided by the RoomHardwareManagementMethods extension

Set audio output device.
setE2EEEnabled(bool enabled) → Future<void>
setSpeakerOn(bool speakerOn, {bool forceSpeakerOutput = false}) → Future<void>

Available on Room, provided by the RoomHardwareManagementMethods extension

speakerOn set speakerphone on or off, by default wired/bluetooth headsets will still be prioritized even if set to true. forceSpeakerOutput if true, will force speaker output even if headphones or bluetooth is connected.
setVideoInputDevice(MediaDevice device) → Future<void>

Available on Room, provided by the RoomHardwareManagementMethods extension

Set video input device.
startAudio() → Future<void>

Available on Room, provided by the RoomHardwareManagementMethods extension

toString() → String
A string representation of this object.
inherited
unregisterByteStreamHandler(String topic) → void

Available on Room, provided by the DataStreamRoomMethods extension

unregisterRpcMethod(String method) → void

Available on Room, provided by the RoomRPCMethods extension

Unregister a handler for incoming RPC requests. @param method, the method name to unregister.
unregisterTextStreamHandler(String topic) → void

Available on Room, provided by the DataStreamRoomMethods extension

withPreConnectAudio<T>(Future<T> operation(), {Duration timeout = const Duration(seconds: 10), PreConnectOnError? onError}) → Future<T>

Available on Room, provided by the RoomPreConnect extension

Runs an async operation while a pre-connect audio buffer records.

Operators

operator ==(Object other) → bool
The equality operator.
inherited