MeetingEventListener Class - React Native
implementation​
- You can implement all the methods of
MeetingEventListener
abstract Class and add the listener toMeeting
class using theaddEventListener()
method ofMeeting
Class.
Example​
- Kotlin
- Java
private final MeetingEventListener meetingEventListener = new MeetingEventListener() {
override fun onMeetingJoined() {
Log.d("#meeting", "onMeetingJoined()")
}
}
private final MeetingEventListener meetingEventListener = new MeetingEventListener() {
@Override
public void onMeetingJoined() {
Log.d("#meeting", "onMeetingJoined()");
}
}
onMeetingJoined()​
- This event will be emitted when a localParticipant successfully joined the meeting.
Example​
- Kotlin
- Java
override fun onMeetingJoined() {
Log.d("#meeting", "onMeetingJoined()")
}
@Override
public void onMeetingJoined() {
Log.d("#meeting", "onMeetingJoined()");
}
onMeetingLeft()​
- This event will be emitted when a localParticipant left the meeting.
Example​
- Kotlin
- Java
override fun onMeetingLeft() {
Log.d("#meeting", "onMeetingLeft()")
}
@Override
public void onMeetingLeft() {
Log.d("#meeting", "onMeetingLeft()");
}
onParticipantJoined()​
- This event will be emitted when a new participant joined the meeting.
Event callback parameters​
- participant: Participant
Example​
- Kotlin
- Java
override fun onParticipantJoined(participant: Participant) {
Log.d("#meeting", participant.displayName + " joined");
}
@Override
public void onParticipantJoined(Participant participant) {
Log.d("#meeting", participant.getDisplayName() + " joined");
}
onParticipantLeft​
- This event will be emitted when a joined participant left the meeting.
Event callback parameters​
- participant: Participant
Example​
- Kotlin
- Java
override fun onParticipantLeft(participant: Participant) {
Log.d("#meeting", participant.displayName + " left");
}
@Override
public void onParticipantLeft(Participant participant) {
Log.d("#meeting", participant.getDisplayName() + " left");
}
onSpeakerChanged()​
- 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 en event callback parameter.
Event callback parameters​
- participantId: String
Example​
- Kotlin
- Java
override fun onSpeakerChanged(participantId: String?) {
//
}
@Override
public void onSpeakerChanged(String participantId) {
//
}
onPresenterChanged()​
- This event will be emitted when any participant starts or stops screen sharing.
- It will pass
participantId
as an event callback parameter. - If a participant stops screensharing, then this event will pass
null
as en event callback parameter.
Event callback parameters​
- participantId: String
Example​
- Kotlin
- Java
override fun onPresenterChanged(participantId: String) {
//
}
@Override
public void onPresenterChanged(String participantId) {
//
}
onEntryRequested()​
- This event will be emitted when a new participant who is trying to join the meeting, is having permission
ask_join
in token. - This event will only be emitted to the participants in the meeting, 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 meeting,allow()
anddeny()
to take required actions.
Event callback parameters​
- peerId: String
- name: String
Example​
- Kotlin
- Java
override fun onEntryRequested(id: String?, name: String?) {
//
}
@Override
public void onEntryRequested(String id, String name) {
//
}
onEntryResponded()​
- This event will be emitted when the
join()
request is responded. - This event will be emitted to the participants in the meeting, who is having the permission
allow_join
in token. - This event will be also emitted to the participant who requested to join the meeting.
Event callback parameters​
- participantId: String
- decision: "allowed" | "denied"
Example​
- Kotlin
- Java
override fun onEntryResponded(id: String?, decision: String?) {
//
}
@Override
public void onEntryResponded(String id, String decision) {
//
}
onWebcamRequested()​
- This event will be emitted to the participant
B
when any other participantA
requests to enable webcam of participantB
. - On accepting the request, webcam of participant
B
will be enabled.
Event callback parameters​
- participantId: String
- listener: WebcamRequestListener { accept: Method; reject: Method }
Example​
- Kotlin
- Java
override fun onWebcamRequested(participantId: String, listener: WebcamRequestListener) {
// if accept request
listener.accept()
// if reject request
listener.reject()
}
@Override
public void onWebcamRequested(String participantId, WebcamRequestListener listener) {
// if accept request
listener.accept();
// if reject request
listener.reject();
}
onMicRequested()​
- 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 callback parameters​
- participantId: String
- listener: MicRequestListener { accept: Method; reject: Method }
Example​
- Kotlin
- Java
override fun onMicRequested(participantId: String, listener: MicRequestListener) {
// if accept request
listener.accept()
// if reject request
listener.reject()
}
@Override
public void onMicRequested(String participantId, MicRequestListener listener) {
// if accept request
listener.accept();
// if reject request
listener.reject();
}
onRecordingStarted()​
- This event will be emitted when recording of the meeting is started.
Example​
- Kotlin
- Java
override fun onRecordingStarted() {
//
}
@Override
public void onRecordingStarted() {
//
}
onRecordingStopped()​
- This event will be emitted when recording of the meeting is stopped.
Example​
- Kotlin
- Java
override fun onRecordingStopped() {
//
}
@Override
public void onRecordingStopped() {
//
}
onLivestreamStarted()​
- This event will be emitted when
RTMP
live stream of the meeting is started.
Example​
- Kotlin
- Java
override fun onLivestreamStarted() {
//
}
@Override
public void onLivestreamStarted() {
//
}
onLivestreamStopped()​
- This event will be emitted when
RTMP
live stream of the meeting is stopped.
Example​
- Kotlin
- Java
override fun onLivestreamStopped() {
//
}
@Override
public void onLivestreamStopped() {
//
}
onExternalCallStarted()​
- This event will be emitted when local particpant receive incoming call.
Example​
- Kotlin
- Java
override fun onExternalCallStarted() {
//
}
@Override
public void onExternalCallStarted() {
//
}
onMeetingStateChanged()​
- This event will be emitted when state of meeting changes.
- It will pass
state
as an event callback parameter which will indicate current state of the meeting. - All available states are
CONNECTING
,CONNECTED
,FAILED
,DISCONNECTED
,CLOSING
,CLOSED
.
Event callback parameters​
- state: String
Example​
- Kotlin
- Java
override fun onMeetingStateChanged(state: String?) {
when (state) {
"CONNECTING" -> Log.d("onMeetingStateChanged: ", "Meeting is Connecting")
"CONNECTED" -> Log.d("onMeetingStateChanged: ", "Meeting is Connected")
"FAILED" -> Log.d("onMeetingStateChanged: ", "Meeting connection failed")
"DISCONNECTED" -> Log.d("onMeetingStateChanged: ","Meeting connection disconnected abruptly")
"CLOSING" -> Log.d("onMeetingStateChanged: ", "Meeting is closing")
"CLOSED" -> Log.d("onMeetingStateChanged: ", "Meeting connection closed")
}
}
@Override
public void onMeetingStateChanged(String state) {
switch (state) {
case "CONNECTING":
Log.d("onMeetingStateChanged: ", "Meeting is Connecting");
break;
case "CONNECTED":
Log.d("onMeetingStateChanged: ", "Meeting is Connected");
break;
case "FAILED":
Log.d("onMeetingStateChanged: ", "Meeting connection failed");
break;
case "DISCONNECTED":
Log.d("onMeetingStateChanged: ", "Meeting connection disconnected abruptly");
break;
case "CLOSING":
Log.d("onMeetingStateChanged: ", "Meeting is closing");
break;
case "CLOSED":
Log.d("onMeetingStateChanged: ", "Meeting connection closed");
break;
}
}
Got a Question? Ask us on discord