Client API and events
Names below use TypeScript semantics. Follow the platform guides for actual signatures and Version notes for source/release differences.
Common methods
| API | Meaning |
|---|---|
initialize / enterClassroom | Initialize and enter; Web initialize receives the classroom |
startClass / endClass | Start/end class, subject to role and state |
leaveClassroom / destroy | Leave as current user / release instance |
getClassInfo | Read lifecycle, class information and timer |
getClassroomInteractionPolicy | Read action availability and restriction reasons |
setLocalAudioMuted / setLocalVideoMuted | Accept local device changes; false requests opening |
userRaiseHand / userCancelHand / userLeaveStage | Raise/cancel hand and leave stage |
inviteUserOnStage / approveUserOnStage / rejectUserOnStage / removeUserFromStage | Teacher stage management |
getOnStageUserList / getRaisedHandList | Read stage and raised-hand lists |
getUserPermissionList / loadMemberPermissions | Read own permissions / asynchronously load member permissions |
sendImMessage / getImMessageList | Send group text / read current message window |
loadImMessageHistory / getImHistoryState | Load history / read pagination state |
getClassroomCourseware / getCoursewareManifest | Read bound courseware / asynchronously load manifest |
History defaults to 50 messages per page with limit 1–100. Use returned nextCursor for subsequent pages. getImMessageList() reads at most 200 in-memory messages without requesting history. Load a courseware manifest only when status === 'ready'; do not block the rendering thread.
Event subscription
Web/mini programs use sdk.on, which returns an unsubscribe function:
const unsubscribe = sdk.on('onStreamInfoChanged', (streams) => {
renderStreams(streams);
});
// When the view no longer needs this subscription:
unsubscribe();
Kotlin uses addStreamInfoChangedListener; Swift uses onStreamInfoChanged. destroy clears subscriptions. Avoid updating unmounted views from callbacks.
| API | Meaning |
|---|---|
onJoinSuccess | Required backend and IM domains are ready |
onJoinProgress | Connection phase and capability-domain states |
onClassInfoChanged | Class information and lifecycle changes |
onOnStageUsersChanged | On-stage membership changes |
onUserPermissionsChanged | Effective permission changes |
onStreamInfoChanged | Actual local/remote stream state changes |
onImMessageReceived | Notification after message state updates |
onWhiteboardRecoveryRequested | Request whiteboard reload after recovery |
onWhiteboardLiveStrokeReceived | Ephemeral live strokes, not final operation commits |
onError | Asynchronous SDK errors |
Do not display a device as open merely because its command returned; wait for onStreamInfoChanged. Teacher-muted callbacks also follow actual device closure.
Whiteboard and teaching tools
UI Kit handles DrawsKit mounting and synchronization. Headless hosts connect whiteboard adapters, synchronization and recovery events. sendWhiteboardSync and sendWhiteboardLiveStroke primarily serve that adapter layer.
Source builds submit teaching-tool requests through requestTeachingTools(requestJson). Correlate operation results by request ID in the tool view. Available tools depend on server deployment; the teaching blackboard is not yet available. See Client SDK overview for platform requirements.