Skip to main content
Version: 0.1.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")
}
}

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, FAILED, DISCONNECTED, CLOSING, CLOSED.

Event callback parameters

  • state: String

Example

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

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

 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