IUserHandler

UserContext contains user-related event callbacks.

onRemoteUserJoined

Occurs when a remote user joins the room.

fun onRemoteUserJoined(user: AgoraEduContextUserInfo)

Parameter

user
For the information of the user who joins the room, see AgoraEduContextUserInfo.

onRemoteUserLeft

Occurs when a remote user leaves the room.

fun onRemoteUserLeft(user: AgoraEduContextUserInfo,
                     operator: AgoraEduContextUserInfo?,
                     reason: EduContextUserLeftReason)

Parameter

user
For the information of the user who leaves the room, see AgoraEduContextUserInfo.
operator
The operator: AgoraEduContextUserInfo. If the remote user is kicked out of the room, the SDK returns this parameter.
reason
The reason for leaving the room. See EduContextUserLeftReason. The default reason is Normal.

onUserUpdated

Occurs when the information of a user is updated.

fun onUserUpdated(user: AgoraEduContextUserInfo,
                  operator: AgoraEduContextUserInfo?,
                  reason: EduContextUserUpdateReason? = null)

Parameter

user
The AgoraEduContextUserInfo of the user whose information is changed.
operator
The operator AgoraEduContextUserInfo, which can be empty.

onCoHostUserListAdded

Occurs when users successfully go onto the "stage".

fun onCoHostUserListAdded(userList: List<AgoraEduContextUserInfo>,
                          operator: AgoraEduContextUserInfo?)

Parameter

userList
The list of users who are still on the "stage", which is an array of AgoraEduContextUserInfo.
operator
The operator AgoraEduContextUserInfo, which can be empty.

onCoHostUserListRemoved

Occurs when users go off the "stage".

fun onCoHostUserListRemoved(userList: List<AgoraEduContextUserInfo>,
                            operator: AgoraEduContextUserInfo?)

Parameter

userList
The list of users who are still on the "stage", which is an array of AgoraEduContextUserInfo.
operator
The operator AgoraEduContextUserInfo, which can be empty.

onUserPropertiesUpdated

Occurs when the custom user properties are updated.

fun onUserPropertiesUpdated(user: AgoraEduContextUserInfo,
                            properties: Map<String, Any>,
                            cause: Map<String, Any>?,
                            operator: AgoraEduContextUserInfo?)

Parameter

user
The user information: AgoraEduContextUserInfo.
properties
The updated user properties.
cause
The update reason.
operator
The operator AgoraEduContextUserInfo, which can be empty.

onUserPropertiesDeleted

Occurs when the custom user properties are deleted.

fun onUserPropertiesDeleted(user: AgoraEduContextUserInfo,
                            keys: List<String>,
                            cause: Map<String, Any>?,
                            operator: AgoraEduContextUserInfo?)

Parameter

user
The user information: AgoraEduContextUserInfo.
keys
Deleted properties.
cause
The reason for deletion.
operator
The operator AgoraEduContextUserInfo, which can be empty.

onUserRewarded

Occurs when the number of a user's rewards changes.

fun onUserRewarded(user: AgoraEduContextUserInfo,
                   rewardCount: Int,
                   operator: AgoraEduContextUserInfo?)

Parameter

user
The user information: AgoraEduContextUserInfo.
rewardCount
The number of rewards.
operator
The operator AgoraEduContextUserInfo, which can be empty.

onLocalUserKickedOut

Occurs when the local user is kicked out of the room.

fun onLocalUserKickedOut()

When the local user is kicked out of the room, the SDK triggers this callback.

onHandsWaveEnabled

Indicates whether the "raising a handing" feature is enabled.

fun onHandsWaveEnabled(enabled: Boolean)

When the "handing raising" feature is enabled, students in the room can "raise their hands" to apply for speak on "stage".

Parameter

enabled
Whether the "raising a handing" feature is enabled.

onUserHandsWave

Occurs when a user raises a hand.

fun onUserHandsWave(user: AgoraEduContextUserInfo, duration: Int)

When a user raises a hand, the SDK triggers this callback.

Parameter

user
The user who raises a hand: AgoraEduContextUserInfo.
duration
How long the hand is to be raised, in seconds.

onUserHandsDown

Occurs when a user puts down the hand.

fun onUserHandsDown(user: AgoraEduContextUserInfo)
The SDK triggers this callback in the following two situations:
  • The student cancels the application for request on the "stage".
  • The teacher accepts the student's application.

Parameter

user
The user whose hand is put down: AgoraEduContextUserInfo.