MeetingEventListener Class - Android
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();
}
onRecordingStateChanged()
- This event will be emitted when the meeting's recording status changed.
Event callback parameters
- recordingState: String
recordingState
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
- Kotlin
- Java
override fun onRecordingStateChanged(recordingState: String) {
when (recordingState) {
"RECORDING_STARTING" -> {
Log.d("onRecordingStateChanged", "Meeting recording is starting")
}
"RECORDING_STARTED" -> {
Log.d("onRecordingStateChanged", "Meeting recording is started")
}
"RECORDING_STOPPING" -> {
Log.d("onRecordingStateChanged", "Meeting recording is stopping")
}
"RECORDING_STOPPED" -> {
Log.d("onRecordingStateChanged", "Meeting recording is stopped")
}
}
}
@Override
public void onRecordingStateChanged(String recordingState) {
switch (recordingState) {
case "RECORDING_STARTING":
Log.d("onRecordingStateChanged", "Meeting recording is starting");
break;
case "RECORDING_STARTED":
Log.d("onRecordingStateChanged", "Meeting recording is started");
break;
case "RECORDING_STOPPING":
Log.d("onRecordingStateChanged", "Meeting recording is stopping");
break;
case "RECORDING_STOPPED":
Log.d("onRecordingStateChanged", "Meeting recording is stopped");
break;
}
}
onRecordingStarted()
This event will be deprecated soon
- 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 deprecated soon
- This event will be emitted when recording of the meeting is stopped.
Example
- Kotlin
- Java
override fun onRecordingStopped() {
//
}
@Override
public void onRecordingStopped() {
//
}
onLivestreamStateChanged()
- This event will be emitted when the meeting's livestream status changed.
Event callback parameters
- livestreamState: String
livestreamState
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.
Example
- Kotlin
- Java
override fun onLivestreamStateChanged(livestreamState: String?) {
when (livestreamState) {
"LIVESTREAM_STARTING" -> Log.d( "LivestreamStateChanged",
"Meeting livestream is starting"
)
"LIVESTREAM_STARTED" -> Log.d( "LivestreamStateChanged",
"Meeting livestream is started"
)
"LIVESTREAM_STOPPING" -> Log.d("LivestreamStateChanged",
"Meeting livestream is stopping"
)
"LIVESTREAM_STOPPED" -> Log.d("LivestreamStateChanged",
"Meeting livestream is stopped"
)
}
}
@Override
public void onLivestreamStateChanged(String livestreamState) {
switch (livestreamState) {
case "LIVESTREAM_STARTING":
Log.d("LivestreamStateChanged", "Meeting livestream is starting");
break;
case "LIVESTREAM_STARTED":
Log.d("LivestreamStateChanged", "Meeting livestream is started");
break;
case "LIVESTREAM_STOPPING":
Log.d("LivestreamStateChanged", "Meeting livestream is stopping");
break;
case "LIVESTREAM_STOPPED":
Log.d("LivestreamStateChanged", "Meeting livestream is stopped");
break;
}
}
onLivestreamStarted()
This event will be deprecated soon
- 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 deprecated soon
- This event will be emitted when
RTMP
live stream of the meeting is stopped.
Example
- Kotlin
- Java
override fun onLivestreamStopped() {
//
}
@Override
public void onLivestreamStopped() {
//
}
onHlsStateChanged()
- This event will be emitted when the meeting's HLS(Http Livestreaming) status changed.
Event callback parameters
-
HlsState: { status: String}
status
has following values :HLS_STARTING
- HLS is in starting phase and hasn't started yet.HLS_STARTED
- HLS has started successfully.HLS_PLAYABLE
- HLS can be playable now.HLS_STOPPING
- HLS is in stopping phase and hasn't stopped yet.HLS_STOPPED
- HLS has stopped successfully.
-
when you receive
HLS_PLAYABLE
status you will receive 2 urls in responseplaybackHlsUrl
- Live HLS with playback supportlivestreamUrl
- Live HLS without playback support
note
downstreamUrl
is now depecated. Use playbackHlsUrl
or livestreamUrl
in place of downstreamUrl
Example
- Kotlin
- Java
override fun onHlsStateChanged(HlsState: JSONObject) {
when (HlsState.getString("status")) {
"HLS_STARTING" -> Log.d("onHlsStateChanged", "Meeting hls is starting")
"HLS_STARTED" -> Log.d("onHlsStateChanged", "Meeting hls is started")
"HLS_PLAYABLE" -> {
Log.d("onHlsStateChanged", "Meeting hls is playable now")
// on hls playable you will receive playbackHlsUrl and livestreamUrl
val playbackHlsUrl = HlsState.getString("playbackHlsUrl")
val livestreamUrl = HlsState.getString("livestreamUrl")
}
"HLS_STOPPING" -> Log.d("onHlsStateChanged", "Meeting hls is stopping")
"HLS_STOPPED" -> Log.d("onHlsStateChanged", "Meeting hls is stopped")
}
}
@Override
public void onHlsStateChanged(JSONObject HlsState) {
switch (HlsState.getString("status")) {
case "HLS_STARTING":
Log.d("onHlsStateChanged", "Meeting hls is starting");
break;
case "HLS_STARTED":
Log.d("onHlsStateChanged", "Meeting hls is started");
break;
case "HLS_PLAYABLE":
Log.d("onHlsStateChanged", "Meeting hls is playable now");
// on hls started you will receive playbackHlsUrl and livestreamUrl
String playbackHlsUrl = HlsState.getString("playbackHlsUrl");
String livestreamUrl = HlsState.getString("livestreamUrl");
break;
case "HLS_STOPPING":
Log.d("onHlsStateChanged", "Meeting hls is stopping");
break;
case "HLS_STOPPED":
Log.d("onHlsStateChanged", "Meeting hls is stopped");
break;
}
}
onTranscriptionStateChanged()
- This event will be triggered whenever state of realtime transcription is changed.
Event callback parameters
- data: { status: String, id: String }
- status: String
- id: String
status
has following values
TRANSCRIPTION_STARTING
- Realtime Transcription is in starting phase and hasn't started yet.TRANSCRIPTION_STARTED
- Realtime Transcription has started successfully.TRANSCRIPTION_STOPPING
- Realtime Transcription is in stopping phase and hasn't stopped yet.TRANSCRIPTION_STOPPED
- Realtime Transcription has stopped successfully.
Example
- Kotlin
- Java
override fun onTranscriptionStateChanged(data: JSONObject) {
//Status can be :: TRANSCRIPTION_STARTING
//Status can be :: TRANSCRIPTION_STARTED
//Status can be :: TRANSCRIPTION_STOPPING
//Status can be :: TRANSCRIPTION_STOPPED
val status = data.getString("status")
Log.d("MeetingActivity", "Transcription status: $status")
}
@Override
public void onTranscriptionStateChanged(JSONObject data) {
//Status can be :: TRANSCRIPTION_STARTING
//Status can be :: TRANSCRIPTION_STARTED
//Status can be :: TRANSCRIPTION_STOPPING
//Status can be :: TRANSCRIPTION_STOPPED
String status = data.getString("status");
Log.d("MeetingActivity", "Transcription status: " + status);
}
onTranscriptionText()
- This event will be emitted when text for running realtime transcription received.
Event callback parameters
- data: TranscriptionText
- TranscriptionText.participantId: String
- TranscriptionText.participantName: String
- TranscriptionText.text: String
- TranscriptionText.timestamp: int
- TranscriptionText.type: String
Example
- Kotlin
- Java
override fun onTranscriptionText(data: TranscriptionText) {
val participantId = data.participantId
val participantName = data.participantName
val text = data.text
val timestamp = data.timestamp
val type = data.type
Log.d("MeetingActivity", "$participantName: $text $timestamp")
}
@Override
public void onTranscriptionText(TranscriptionText data) {
String participantId = data.getParticipantId();
String participantName = data.getParticipantName();
String text = data.getText();
int timestamp = data.getTimestamp();
String type = data.getType();
Log.d("MeetingActivity", participantName + ": " + text + " " + timestamp);
}
onWhiteboardStarted()
- This event will be triggered when the whiteboard is successfully started.
Event callback parameters
url: String
Example
- Kotlin
- Java
override fun onWhiteboardStarted(url: String) {
super.onWhiteboardStarted(url)
//...
}
@Override
public void onWhiteboardStarted(String url) {
super.onWhiteboardStarted(url);
//...
}
onWhiteboardStopped()
- This event will be triggered when the whiteboard session is successfully terminated.
Example
- Kotlin
- Java
override fun onWhiteboardStopped() {
super.onWhiteboardStopped()
//...
}
@Override
public void onWhiteboardStopped() {
super.onWhiteboardStopped();
//...
}
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;
}
}
onParticipantModeChanged()
- This event will be triggered when mode gets changed.
- It will pass
mode
, as an event callback parameter.CONFERENCE
: Both audio and video streams will be produced and consumed in this mode.VIEWER
: Audio and video streams will not be produced or consumed in this mode.
Event callback parameters
- data: { mode: String, participantId: String }
- mode: String
- participantId: String
Example
- Kotlin
- Java
override fun onParticipantModeChanged(data: JSONObject?) {
//
}
@Override
public void onParticipantModeChanged(JSONObject data) {
//
}
onPinStateChanged()
- This event will be triggered when any participant got pinned or unpinned by any participant got pinned or unpinned by any participant.
Event callback parameters
- pinStateData: { peerId: String, state: JSONObject, pinnedBy: String }
- peerId: String
- state: JSONObject
- pinnedBy: String
Example
- Kotlin
- Java
override fun onPinStateChanged(pinStateData: JSONObject?) {
Log.d("onPinStateChanged: ", pinStateData.getString("peerId")) // id of participant who were pinned
Log.d("onPinStateChanged: ", pinStateData.getJSONObject("state")) // { cam: true, share: true }
Log.d("onPinStateChanged: ", pinStateData.getString("pinnedBy")) // id of participant who pinned that participant
}
@Override
public void onPinStateChanged(JSONObject pinStateData) {
Log.d("onPinStateChanged: ", pinStateData.getString("peerId")); // id of participant who were pinned
Log.d("onPinStateChanged: ", pinStateData.getJSONObject("state")); // { cam: true, share: true }
Log.d("onPinStateChanged: ", pinStateData.getString("pinnedBy")); // id of participant who pinned that participant
}
Got a Question? Ask us on discord