In v2.1.0, Agora fully optimizes the internal architecture of the Agora Classroom SDK and refactors the Agora Edu Context APIs.
This section lists the major changes of the Edu Context API between v2.1.0 and v1.1.5.
Remove ChatContext
and IChatHandler
.
Remove WhiteboardContext
and IWhiteboardHandler
. In v2.1.0, the whiteboard feature is implemented in AgoraUIKit
.
Remove DeviceContext
and IDeviceHandler
. Use methods and callbacks in MediaContext
and IMediaHandler
instead, as follows:
getDeviceConfig
. Use getLocalDeviceState
instead.setCameraDeviceEnable
, switchCameraFacing
, setMicDeviceEnable
, and setSpeakerEnable
. Use openSystemDevice
and closeSystemDevice
instead.setDeviceLifecycle
. In v2.1.0, the SDK does not maintain the device state.onCameraDeviceEnableChanged
, onCameraFacingChanged
, onMicDeviceEnabledChanged
, and onSpeakerEnabledChanged
. Use onLocalDeviceStateUpdated
instead.onDeviceTips
.Remove HandsUpContext
and IHandsUpHandler
. Use methods and callbacks in UserContext
and IUserHandler
instead, as follows:
performHandsUp
. Use handsWave
and handsDown
instead.onHandsUpEnabled
. Use onHandsWaveEnabled
instead.onHandsUpStateUpdated
and onHandsUpStateResultUpdated
. Use onUserHandsWave
and onUserHandsDown
instead.onHandsUpTips
.roomInfo
. Use getRoomInfo
instead.leave
. Use leaveRoom
instead.uploadLog
to MonitorContext
.updateFlexRoomProps
. Use updateRoomProperties
and deleteRoomProperties
instead.joinClassroom
as joinRoom
.onClassroomName
. You can call getRoomInfo
to get the room name.onClassState
as onClassStateUpdated
.onClassTime
.onNetworkStateChanged
. Use onLocalNetworkQualityUpdated
in IMonitorHandler
instead.onLogUploaded
. You can get the log serailNumber
with the callback function in the uploadLog
method inMonitorContext
.onConnectionStateChanged
. Use onLocalConnectionUpdated
in IMonitorHandler
instead.onClassTip
.onFlexRoomPropsInitialized
. To get room custom properties after joining the room, you can call getRoomProperties
.onFlexRoomPropsChanged
. Use onRoomPropertiesUpdated
and onRoomPropertiesDeleted
instead.onError
.onClassroomJoinSuccess
and onClassroomJoinFail
. Use callback
in joinRoom
instead.onClassroomLeft
. Use onRoomClosed
instead.ScreenShareContext
. Use StreamContext
instead. When videoSourceType
in AgoraEduContextStreamInfo
is Screen
, you can regard this stream as a screen-sharing video stream.IScreenShareHandler
. Use IStreamHandler
instead. Remove onUpdateScreenShareState
. Use onStreamJoined
, onStreamLeft
, and onStreamUpdated
in IStreamHandler
instead.localUserInfo
. Use getLocalUserInfo
instead.muteVideo
and muteAudio
. Use muteStreams
in StreamContext
instead.renderVideo
. Use startRenderLocalVideo
and startRenderRemoteVideo
in MediaContext
instead.updateFlexUserProps
. Use updateUserProperties
and deleteUserProperties
instead.setVideoEncoderConfig
. Use setLocalVideoConfig
in StreamContext
instead.onUserListUpdated
. Us getAllUserList
and getUserList
in UserContext
and onRemoteUserJoined
, onRemoteUserLeft
, and onUserUpdated
in UserHandler
instead.onCoHostListUpdated
. Use onCoHostUserListAdded
and onCoHostUserListRemoved
instead. You can also get the information of all on-stage users through getCoHostList
in UserContext
.onUserReward
to onUserRewarded
.onKickOut
as onLocalUserKickedOut
.onUserTip
and onRoster
.onFlexUserPropsChanged
. Use onUserPropertiesUpdated
and onUserPropertiesDeleted
in IUserHandler
instead. You can also get custom user properties through getUserProperties
in UserContext
.