Meeting Events - Android
VideoSDK provides multiple types of events which can be listened to know the current state of the meeting.
You can implement all the methods of MeetingEventListener
abstract Class and add the listener to Meeting
class using the addEventListener()
method of Meeting
Class.
Here are the events which specifically relate to the meeting.
onMeetingJoined
- This event is triggered when the meeting is successfully joined.
onMeetingLeft
- This event is triggered when the meeting is left.
onSpeakerChanged
- This event is triggered when the active speaker in the meeting gets changed.
onPresenterChanged
- This event is triggered when the presenter in the meeting gets changed.
Example
Here is the usage of all the events mentioned in this page.
- Kotlin
- Java
private val meetingEventListener: MeetingEventListener = object : MeetingEventListener() {
override fun onMeetingJoined() {
Log.d("VideoSDK", "onMeetingJoined: ")
}
override fun onMeetingLeft() {
Log.d("VideoSDK", "onMeetingLeft: ")
}
override fun onSpeakerChanged(participantId: String) {
Log.d("VideoSDK", "onSpeakerChanged: $participantId")
}
override fun onPresenterChanged(participantId: String) {
Log.d("VideoSDK", "onPresenterChanged: $participantId")
}
}
override fun onCreate(savedInstanceState: Bundle?) {
//...
// add listener to meeting
meeting!!.addEventListener(meetingEventListener)
}
private final MeetingEventListener meetingEventListener = new MeetingEventListener() {
@Override
public void onMeetingJoined() {
Log.d("VideoSDK", "onMeetingJoined: ");
}
@Override
public void onMeetingLeft() {
Log.d("VideoSDK", "onMeetingLeft: ");
}
@Override
public void onSpeakerChanged(String participantId) {
Log.d("VideoSDK", "onSpeakerChanged: " + participantId);
}
@Override
public void onPresenterChanged(String participantId) {
Log.d("VideoSDK", "onPresenterChanged: " + participantId);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
//...
// add listener to meeting
meeting.addEventListener(meetingEventListener);
}
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord