Migration guide
This page shows you how to upgrade to the latest version of Flexible Classroom.
Migrate from v1.1.5 to v2.1.0
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.
Chat context
Remove ChatContext
and IChatHandler
.
Whiteboard context
Remove WhiteboardContext
and IWhiteboardHandler
. In v2.1.0, the whiteboard feature is implemented in AgoraUIKit
.
Device context
Remove DeviceContext
and IDeviceHandler
. Use methods and callbacks in MediaContext
and IMediaHandler
instead, as follows:
- Remove
getDeviceConfig
. UsegetLocalDeviceState
instead. - Remove
setCameraDeviceEnable
,switchCameraFacing
,setMicDeviceEnable
, andsetSpeakerEnable
. UseopenSystemDevice
andcloseSystemDevice
instead. - Remove
setDeviceLifecycle
. In v2.1.0, the SDK does not maintain the device state. - Remove
onCameraDeviceEnableChanged
,onCameraFacingChanged
,onMicDeviceEnabledChanged
, andonSpeakerEnabledChanged
. UseonLocalDeviceStateUpdated
instead. - Remove
onDeviceTips
.
Hands-up context
Remove HandsUpContext
and IHandsUpHandler
. Use methods and callbacks in UserContext
and IUserHandler
instead, as follows:
- Remove
performHandsUp
. UsehandsWave
andhandsDown
instead. - Remove
onHandsUpEnabled
. UseonHandsWaveEnabled
instead. - Remove
onHandsUpStateUpdated
andonHandsUpStateResultUpdated
. UseonUserHandsWave
andonUserHandsDown
instead. - Remove
onHandsUpTips
.
Room context
- Remove
roomInfo
. UsegetRoomInfo
instead. - Remove
leave
. UseleaveRoom
instead. - Move
uploadLog
toMonitorContext
. - Remove
updateFlexRoomProps
. UseupdateRoomProperties
anddeleteRoomProperties
instead. - Rename
joinClassroom
asjoinRoom
. - Remove
onClassroomName
. You can callgetRoomInfo
to get the room name. - Rename
onClassState
asonClassStateUpdated
. - Remove
onClassTime
. - Remove
onNetworkStateChanged
. UseonLocalNetworkQualityUpdated
inIMonitorHandler
instead. - Remove
onLogUploaded
. You can get the logserailNumber
with the callback function in theuploadLog
method inMonitorContext
. - Remove
onConnectionStateChanged
. UseonLocalConnectionUpdated
inIMonitorHandler
instead. - Remove
onClassTip
. - Remove
onFlexRoomPropsInitialized
. To get room custom properties after joining the room, you can callgetRoomProperties
. - Remove
onFlexRoomPropsChanged
. UseonRoomPropertiesUpdated
andonRoomPropertiesDeleted
instead. - Remove
onError
. - Remove
onClassroomJoinSuccess
andonClassroomJoinFail
. Usecallback
injoinRoom
instead. - Remove
onClassroomLeft
. UseonRoomClosed
instead.
Screen-sharing context
- Remove
ScreenShareContext
. UseStreamContext
instead. WhenvideoSourceType
inAgoraEduContextStreamInfo
isScreen
, you can regard this stream as a screen-sharing video stream. - Remove
IScreenShareHandler
. UseIStreamHandler
instead. RemoveonUpdateScreenShareState
. UseonStreamJoined
,onStreamLeft
, andonStreamUpdated
inIStreamHandler
instead.
User context
- Remove
localUserInfo
. UsegetLocalUserInfo
instead. - Remove
muteVideo
andmuteAudio
. UsemuteStreams
inStreamContext
instead. - Remove
renderVideo
. UsestartRenderLocalVideo
andstartRenderRemoteVideo
inMediaContext
instead. - Remove
updateFlexUserProps
. UseupdateUserProperties
anddeleteUserProperties
instead. - Remove
setVideoEncoderConfig
. UsesetLocalVideoConfig
inStreamContext
instead. - Remove
onUserListUpdated
. UsgetAllUserList
andgetUserList
inUserContext
andonRemoteUserJoined
,onRemoteUserLeft
, andonUserUpdated
inUserHandler
instead. - Remove
onCoHostListUpdated
. UseonCoHostUserListAdded
andonCoHostUserListRemoved
instead. You can also get the information of all on-stage users throughgetCoHostList
inUserContext
. - Rename
onUserReward
toonUserRewarded
. - Rename
onKickOut
asonLocalUserKickedOut
. - Remove
onUserTip
andonRoster
. - Remove
onFlexUserPropsChanged
. UseonUserPropertiesUpdated
andonUserPropertiesDeleted
inIUserHandler
instead. You can also get custom user properties throughgetUserProperties
inUserContext
.