AgoraEduRoomContext

The AgoraEduRoomContext class.

joinRoom

Joins a room.

void joinRoom(Callback<Void> success,
              Callback<AgoraEduContextError> fail)

Parameter

success
If the method call succeeds, the SDK returns the current room information AgoraEduContextRoomInfo.
fail
If the method call fails, the SDK returns AgoraEduContextError.

leaveRoom

Leaves the room.

void leaveRoom(Callback<Void> success,
               Callback<AgoraEduContextError> fail)

Parameter

success
The user leaves the room successfully.
fail
If the method call fails, the SDK returns AgoraEduContextError.

getRoomProperties

Gets custom room properties.

Map<String, Any> getRoomProperties()

Returns

If the method call succeeds, the SDK returns Map<String, Any>.

updateRoomProperties

Adds or updates custom room properties.

void updateRoomProperties(Map<String, Any> properties,
                          Map<String, Any> cause,
                          Callback<Void> success,
                          Callback<AgoraEduContextError> fail)

For details, see How can I set custom room properties?

After you successfully update the property, the SDK triggers onRoomPropertiesUpdated.

Parameter

properties
Room properties.
cause
The update reason. This parameter can be null.
success
The method call succeeds.
fail
If the method call fails, the SDK returns AgoraEduContextError.

deleteRoomProperties

Deletes custom room properties.

void deleteRoomProperties(Array<String> keyPaths,
                          Map<String, Any> cause,
                          Callback<Void> success,
                          Callback<AgoraEduContextError> fail)

Parameter

keyPaths
The key path of the property that you want to delete, such as key1.subkey1.
cause
The reason for deletion. This parameter can be null.
success
The method call succeeds.
fail
If the method call fails, the SDK returns AgoraEduContextError.