Skip to main content

Local User - Events

You can subscribe to various events on the local user by implementing RtkSelfEventListener and passing the object to meeting.addSelfEventListener(rtkSelfEventListener).

Video update

Called when the user starts / stops the video using enableVideo()/ disableVideo(), or host turns-off user's video.

class LocalUserListener implements RtkSelfEventListener {

...


void onVideoUpdate(bool videoEnabled) {
if(videoEnabled){
// video is enabled, and other participants in room can see local user
} else {
// video is disabled, and other participants in room can not see local user.
}
}

...
}

Audio update

Called when the user starts / stops the audio using enableAudio()/ disableAudio(), or host mutes user's audio.


class LocalUserListener implements RtkSelfEventListener {

...


void onAudioUpdate(bool audioEnabled) {
if (audioEnabled) {
// audio is enabled, and other participants in room can hear local user
} else {
// audio is disabled, and other participants in room can not hear local user.
}
}
...
}

Waitlist status

When the local user is waitlisted in their preset, you can use the onWaitListStatusUpdate() callback to listen to their waiting room status changes.


class LocalUserNotifier implements RtkSelfEventListener {

...


void onWaitListStatusUpdate(WaitlistStatus waitlistStatus) {
// WaitlistStatus is an enum with the following values:
// if `WaitlistStatus.none`, user is not on the waitlist
// if `WaitlistStatus.waiting`, user is on the waitlist
// if `WaitlistStatus.accepted`, user has been accepted in the meeting.
// if `WaitlistStatus.rejected`, user has been rejected from the meeting.
}

...
}

Local user removed

When the local user is removed from the meeting, the onRemovedFromMeeting() callback is called.


class LocalUserNotifier implements RtkSelfEventListener {

...


void onRemovedFromMeeting() {
// Display an alert to the user indicating that they are no longer in the meeting.
}

...
}

Screenshare callbacks for local user


class LocalUserNotifier implements RtkSelfEventListener {

...



void onScreenShareStartFailed(String reason) {
// screenshare failed to start
}


void onScreenShareUpdate(bool isEnabled) {
if (isEnabled) {
// screen-share is enabled
} else {
// screen-share is disabled
}
}

...
}

Change in audio/video source

Whenever user changes audio/video source using setAudioDevice(AudioDevice) and setVideoDevice(VideoDevice) [ref: here], onAudioDevicesUpdated() and onVideoDeviceChanged() are called respectively.


class LocalUserNotifier implements RtkSelfEventListener {

...


void onAudioDevicesUpdated() {
// called when audio device is changed
}


void onVideoDeviceChanged(VideoDevice videoDevice) {
// called when video device is changed to [videoDevice] param
}

...

}