Skip to main content
Version: 0.3.x

MeetingEventListener Class - Android


implementationโ€‹

  • You can implement all the methods of MeetingEventListener abstract Class and add the listener to Meeting class using the addEventListener() method of Meeting Class.

Exampleโ€‹

private final MeetingEventListener meetingEventListener = new MeetingEventListener() {
override fun onMeetingJoined() {
Log.d("#meeting", "onMeetingJoined()")
}
}

onMeetingJoined()โ€‹

  • This event will be emitted when a localParticipant successfully joined the meeting.

Exampleโ€‹

 override fun onMeetingJoined() {
Log.d("#meeting", "onMeetingJoined()")
}

onMeetingLeft()โ€‹

Exampleโ€‹

 override fun onMeetingLeft() {
Log.d("#meeting", "onMeetingLeft()")
}

onParticipantJoined()โ€‹

  • This event will be emitted when a new participant joined the meeting.

Event callback parametersโ€‹

Exampleโ€‹

 override fun onParticipantJoined(participant: Participant) {
Log.d("#meeting", participant.displayName + " joined");
}

onParticipantLeftโ€‹

  • This event will be emitted when a joined participant left the meeting.

Event callback parametersโ€‹

Exampleโ€‹

 override fun onParticipantLeft(participant: Participant) {
Log.d("#meeting", participant.displayName + " 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โ€‹

 override fun onSpeakerChanged(participantId: String?) {
//
}

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โ€‹

 override fun onPresenterChanged(participantId: String) {
//
}

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 and name of the new participant who is trying to join the meeting, allow() and deny() to take required actions.

Event callback parametersโ€‹

  • peerId: String
  • name: String

Exampleโ€‹

 override fun onEntryRequested(id: String?, name: String?) {
//
}

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โ€‹

 override fun onEntryResponded(id: String?, decision: String?) {
//
}

onWebcamRequested()โ€‹

  • This event will be emitted to the participant B when any other participant A requests to enable webcam of participant B.
  • On accepting the request, webcam of participant B will be enabled.

Event callback parametersโ€‹

  • participantId: String
  • listener: WebcamRequestListener { accept: Method; reject: Method }

Exampleโ€‹

  override fun onWebcamRequested(participantId: String, listener: WebcamRequestListener) {
// if accept request
listener.accept()

// if reject request
listener.reject()
}

onMicRequested()โ€‹

  • This event will be emitted to the participant B when any other participant A requests to enable mic of participant B.
  • On accepting the request, mic of participant B will be enabled.

Event callback parametersโ€‹

  • participantId: String
  • listener: MicRequestListener { accept: Method; reject: Method }

Exampleโ€‹

 override fun onMicRequested(participantId: String, listener: MicRequestListener) {
// 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โ€‹

  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")
}
}
}

onRecordingStarted()โ€‹

This event will be deprecated soon

  • This event will be emitted when recording of the meeting is started.

Exampleโ€‹

 override fun onRecordingStarted() {
//
}

onRecordingStopped()โ€‹

This event will be deprecated soon

  • This event will be emitted when recording of the meeting is stopped.

Exampleโ€‹

 override fun 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โ€‹

  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"
)
}
}

onLivestreamStarted()โ€‹

This event will be deprecated soon

  • This event will be emitted when RTMP live stream of the meeting is started.

Exampleโ€‹

 override fun onLivestreamStarted() {
//
}

onLivestreamStopped()โ€‹

This event will be deprecated soon

  • This event will be emitted when RTMP live stream of the meeting is stopped.

Exampleโ€‹

 override fun 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 response

    • playbackHlsUrl - Live HLS with playback support
    • livestreamUrl - Live HLS without playback support
note

downstreamUrl is now depecated. Use playbackHlsUrl or livestreamUrl in place of downstreamUrl

Exampleโ€‹

  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")
}
}

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โ€‹

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")
}

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โ€‹

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")
}

onWhiteboardStarted()โ€‹

  • This event will be triggered when the whiteboard is successfully started.

Event callback parametersโ€‹

url: String

Exampleโ€‹

override fun onWhiteboardStarted(url: String) {
super.onWhiteboardStarted(url)
//...
}

onWhiteboardStopped()โ€‹

  • This event will be triggered when the whiteboard session is successfully terminated.

Exampleโ€‹

override fun onWhiteboardStopped() {
super.onWhiteboardStopped()
//...
}

onExternalCallStarted()โ€‹

  • This event will be emitted when local particpant receive incoming call.

Exampleโ€‹

 override fun 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, RECONNECTING, DISCONNECTED.

Event callback parametersโ€‹

  • state: MeetingState

Exampleโ€‹

override fun onMeetingStateChanged(state: ConnectionState) {
super.onMeetingStateChanged(state)
Log.d("TAG", "onMeetingStateChanged: $state")
}

onExternalCallRinging()โ€‹

This callback is triggered when the user's phone starts ringing. whether itโ€™s a traditional phone call or a VoIP call (e.g., WhatsApp).

This event allows us to detect when the user is receiving an external call.

Exampleโ€‹

override fun onExternalCallRinging() {
Log.d("#meeting", "onExternalCallAnswered: User phone is ringing")
}


onExternalCallStarted()โ€‹

This callback is triggered when the user answers an external phone call. whether itโ€™s a traditional phone call or a VoIP call (e.g., WhatsApp).

This event allows us to detect when the user has started a call.

Exampleโ€‹

override fun onExternalCallStarted() {
Log.d("#meeting", "onExternalCallAnswered: User call is answered")
}

onExternalCallHangup()โ€‹

This callback is triggered when an external call ends, whether itโ€™s a traditional phone call or a VoIP call (e.g., WhatsApp).

This event detects when a call has ended

Exampleโ€‹

override fun onExternalCallHangup() {
Log.d("#meeting", "onExternalCallAnswered: User call ends")
}

onPausedAllStreams()โ€‹

  • This callback is triggered when all or specified media streams within the meeting are successfully paused

Parametersโ€‹

  • kind: Specifies the type of media stream that was paused.
    • Type: String
    • Possible values:
      • "audio": Indicates that audio streams have been paused.
      • "video": Indicates that video streams have been paused.
      • "share": Indicates that screen-sharing video streams have been paused

Exampleโ€‹

override fun onPausedAllStreams(kind: String) {
Log.d("TAG", "onPausedAllStreams: $kind")
super.onPausedAllStreams(kind)
}

onResumedAllStreams()โ€‹

  • This callback is triggered when all or specified media streams within the meeting are successfully resumed

Parametersโ€‹

  • kind: Specifies the type of media stream that was resumed.
    • Type: String
    • Possible values:
      • "audio": Indicates that audio streams have been resumed.
      • "video": Indicates that video streams have been resumed.
      • "share": Indicates that screen-sharing video streams have been resumed

Exampleโ€‹

override fun onResumedAllStreams(kind: String) {
Log.d("TAG", "onResumedAllStreams: $kind")
super.onResumedAllStreams(kind)
}

onParticipantModeChanged()โ€‹

This event is triggered when a participant's mode is updated.

It passes data as an event callback parameter, which includes the following:

  • SEND_AND_RECV: Both audio and video streams will be produced and consumed.

  • SIGNALLING_ONLY: Audio and video streams will not be produced or consumed. It is used solely for signaling.

  • RECV_ONLY: Only audio and video streams will be consumed without producing any. This event is triggered when a participant's mode is updated.

Event Callback Parametersโ€‹

  • data: { mode: String, participantId: String }
    • mode: String
    • participantId: String
info

Important Changes Android SDK in Version v0.2.0

  • The following modes have been deprecated:
    • CONFERENCE has been replaced by SEND_AND_RECV
    • VIEWER has been replaced by SIGNALLING_ONLY

Please update your implementation to use the new modes.

โš ๏ธ Compatibility Notice:
To ensure a seamless meeting experience, all participants must use the same SDK version.
Do not mix version v0.2.0 + with older versions, as it may cause significant conflicts.

Exampleโ€‹

 override fun onParticipantModeChanged(data: JSONObject?) {
//...
}

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โ€‹

 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
}

Got a Question? Ask us on discord