Room class

Inheritance

Constructors

Room.create({bool? autoConsume, Map<String, dynamic>? activeSpeakers})
Create a new Room Instance if not created, else return the existing Room Instance @returns - Room Instance
factory
Room.getInstance()
Get the Room Instance if its not initialized it will throw an error @returns - Room Instance
factory

Properties

activeSpeakers Map<String, int>
If using activeSpeakerNotification, Returns back the size of peers which are returned for the activeSpeakers in the Room; Default value is 8
getter/setter pair
autoConsume bool
Auto consume flag, if set to true, Peers Joining the Room will automatically consume the media streams of the remote peers @default true
getter/setter pair
config Map<String, dynamic>
Room Config Object
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
lobbyPeerIds List<String>
Get lobby peers in the form of list
no setter
lobbyPeersMap Map<String, dynamic>
Get the lobby peers in the form of map
getter/setter pair
metadata String
Setter function for the metadata of the room Note: This will not update the metadata of the room, this is just a setter function for the metadata To notify everyone in the room about the metadata change, use the updateMetadata function
no getter
newLobbyPeers List
Set lobby peers in the form of array
no getter
peerIds List<String>
Returns the PeerIds of the remote peers
no setter
remotePeers Map<String, RemotePeer>
Remote Peers Map, Stores all the remote peers
getter/setter pair
roomId String?
RoomId of the currently joined room.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionId String?
getter/setter pair
socket Socket
Returns the instance of the socket connection
no setter
state RoomStates
Set the state of the room
getter/setter pair
stats Map<String, String>
Get Room Stats
getter/setter pair

Methods

admitPeer(String peerId) → void
Admit a Peer to the room who is in the lobby
callback(Function func, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5]) → dynamic
inherited
callbackAsFuture(Function func, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5]) Future
inherited
clearListeners() → void
This function unbinds all the handlers for all the events
inherited
close({String? reason}) → void
closing the room for the current user, room will keep on running for the remote users @deprecated - Use leaveRoom from huddleClient instead
closeStreamOfLabel(String label, List<String>? peerIds) → void
Close a particular stream of remote peers @param data: { label: string; peerIds?: string[] } @param label: Label of the stream @param peerIds: PeerIds of the remote peers, if not provided, it will close the stream of all the remote peers
connect() Room
Connects to the room and returns the instance of the room @throws { Error } If the socket connection is not connected, or if the socket connection is connecting
denyPeer(String peerId) → void
Denies the peer from joining the room, who is in the lobby
emit(String event, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5]) → void
This function triggers all the handlers currently listening to event and passes them data.
inherited
emitAsFuture(String event, [dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5]) Future
This function triggers all the handlers currently listening to event and passes them data.
inherited
getLobbyPeerMetadata(String peerId) Map<String, dynamic>
getMetadata<T>() → T
Get the metadata of the room
getRemotePeerById(String peerId) RemotePeer
Returns the Remote Peer if present in room. @param peerId - PeerId of the remote peer @returns - RemotePeer Instance @throws { Error } If the Remote Peer is not found
kickPeer(String peerId) → void
kick peer from room with respective peerId
listeners(dynamic event) List
Return function list named event.
inherited
muteEveryone() → void
Mute everyone in the room. This will close the audio stream of all the remote peers who dont have admin permissions NOTE: This will target all the audio stream in the room with the label "audio"
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String event) → void
This function attempts to unbind all the handler from the event
inherited
on(String event, Function handler) → void
This function binds the handler as a listener to the event
inherited
once(String event, Function handler) → void
This function binds the handler as a listener to the first occurrence of the event. When handler is called once, it is removed.
inherited
remotePeerExists(String peerId) RemotePeer?
Returns the Remote Peer with the given peerId is present in the room. Returns null if the peer is not present in the room. @param peerId - PeerId of the remote peer @returns - RemotePeer Instance
remove(String event, Function handler) → void
This function attempts to unbind the handler from the event
inherited
removeAllListeners([dynamic eventName]) → void
inherited
removeLobbyPeer(String peerId) → void
Removed Lobby PeerId from the lobby @param peerId - PeerId of the peer who joined the room
safeEmit(String event, [Map<String, dynamic>? args]) → void
inherited
safeEmitAsFuture(String event, [Map<String, dynamic>? args]) Future
inherited
toString() String
A string representation of this object.
inherited
updateMetadata<T>(T data) → void
Update Metadata of the room
updateRoomControls(Map<String, dynamic> data) → void

Operators

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