Room Class Events - Flutter
roomJoined
- This event will be emitted when a localParticipant successfully joined the room.
Example
room.on(Events.roomJoined, (){
// do something
});
roomLeft
- This event will be emitted when a localParticipant left the room.
Example
room.on(Events.roomLeft, () {
// do something
});
participantJoined
- This event will be emitted when a new participant joined the room.
Event handler parameters
- participant: Participant
Example
room.on(Events.participantJoined, (participant) {
// do something
});
participantLeft
- This event will be emitted when a joined participant left the room.
Event handler parameters
- participant: Participant
Example
room.on(Events.participantLeft, (participant) {
// do something
});
speakerChanged
- This event will be emitted when a active speaker changed.
- If you want to know which participant is actively speaking, then this event will be used.
- If no participant is actively speaking, then this event will pass
null
as an event handler parameter.
Event handler parameters
- activeSpeakerId: String?
Example
room.on(Events.speakerChanged, (activeSpeakerId) {
// do something
});
presenterChanged
- This event will be emitted when any participant starts or stops screen sharing.
- It will pass
participantId
as an event handler parameter. - If a participant stops screen-sharing, then this event will pass
null
as en event handler parameter.
Event handler parameters
- activePresenterId: String?
Example
room.on(Events.presenterChanged, (activePresenterId) {
// do something
});
pinStateChanged
- This event will be emitted when any participant pin state gets changed.
- It will pass
participantId
,state
, andpinnedBy
asMap<String, dynamic>
as an event handler parameter.
Event handler parameters
- data:
Map{'<'}String{','} dynamic>
{participantId:String, state:Map<String, dynamic>, pinnedBy:String}
Example
room.on(Events.pinStateChanged, (data) {
// do something
});
participantModeChanged
- This event will be emitted when any participant mode gets changed.
- It will pass
participantId
, andpinnedBy
asMap<String, dynamic>
as an event handler parameter.
Event handler parameters
- data:
Map<String, dynamic>
{participantId:String, mode:String}
Example
room.on(Events.participantModeChanged, (data) {
// do something
});
entryRequested
- This event will be emitted when a new participant, who is trying to join the room, is having permission
ask_join
in token. - This event will only be emitted to the participants in the room, who is having the permission
allow_join
in token. - This event will pass following parameters as an event parameters,
participantId
andname
of the new participant who is trying to join the room,allow()
anddeny()
to take required actions.
Event handler parameters
- data:
Map<String, dynamic>
{ "allow": Function; "deny": Function; "name": String; "participantId": String }- allow: Function
- deny: Function
- name: String
- participantId: String
Example
room.on(Events.entryRequested, (data){
String? participantId = data["participantId"];
String? name = data["name"];
Function allow = data["allow"];
Function deny = data["deny"];
print("$name requested to join the room.");
// If you want to allow the entry request
allow();
// if you want to deny the entry request
deny();
});
entryResponded
- This event will be emitted when the
join()
request is responded. - This event will be emitted to the participants in the room, who is having the permission
allow_join
in token. - This event will be also emitted to the participant, who requested to join the room.
Event handler parameters
- participantId: String
- decision: "allowed" | "denied"
Example
room.on(Events.entryResponded, (participantId, decision) {
// participantId will be id of participant, who requested to join room
if (decision === "allowed") {
// entry allowed
} else {
// entry denied
}
});
cameraRequested
- This event will be emitted to the participant
B
when any other participantA
requests to enable camera of participantB
. - On accepting the request, camera of participant
B
will be enabled.
Event handler parameters
- data:
Map<String, dynamic>
{ accept: Function; participantId: String; reject: Function }- accept: Function
- participantId: String
- reject: Function
Example
room.on(Events.cameraRequested, (data) {
String? participantId = data["participantId"];
Function accept = data["accept"];
Function reject = data["deny"];
// participantId, will be the id of participant who requested to enable camera
// if accept request
accept();
// if reject request
reject();
});
micRequested
- This event will be emitted to the participant
B
when any other participantA
requests to enable mic of participantB
. - On accepting the request, mic of participant
B
will be enabled.
Event handler parameters
- data: Map<String, dynamic>{ accept: Function; participantId: String; reject: Function }
- accept: Function
- participantId: String
- reject: Function
Example
room.on(Events.micRequested, (data) {
String participantId = data["participantId"];
Function accept = data["accept"];
Function reject = data["reject"];
// participantId, will be the id of participant who requested to enable camera
// if accept request
accept();
// if reject request
reject();
});
recordingStarted
This event will be deprecated soon
- This event will be emitted when recording of the room is started.
Example
room.on(Events.recordingStarted, () {
// do something
});
recordingStopped
This event will be deprecated soon
- This event will be emitted when recording of the room is stopped.
Example
room.on(Events.recordingStopped, () {
// do something
});
recordingStateChanged
- This event will be emitted when the meeting's recording status changed.
Event callback parameters
- status: String
status
has following values
RECORDING_STARTING
- Recording is in starting phase and hasn't started yet.RECORDING_STARTED
- Recording has started successfully.RECORDING_STOPPING
- Recording is in stopping phase and hasn't stopped yet.RECORDING_STOPPED
- Recording has stopped successfully.
Example
room.on(Events.recordingStateChanged, (String status) {
log("Meeting recording status : $status");
});
liveStreamStarted
This event will be deprecated soon
- This event will be emitted when
RTMP
live stream of the room is started.
Example
room.on(Events.liveStreamStarted, () {
// do something
});
liveStreamStopped
This event will be deprecated soon
- This event will be emitted when
RTMP
live stream of the room is stopped.
Example
room.on(Events.liveStreamStopped, () {
// do something
});
livestreamStateChanged
- This event will be emitted when the meeting's livestream status changed.
Event callback parameters
- status: String
status
has following values
LIVESTREAM_STARTING
- Livestream is in starting phase and hasn't started yet.LIVESTREAM_STARTED
- Livestream has started successfully.LIVESTREAM_STOPPING
- Livestream is in stopping phase and hasn't stopped yet.LIVESTREAM_STOPPED
- Livestream has stopped successfully.