Skip to main content

Classroom lifecycle

Classroom state transitions

Swipe horizontally to see the full diagram

Classroom state transitionsThe server determines class state. ended means the class has ended; expired means it expired before starting. A client leaving does not end the class for everyone.Not startednot_startedcreating / pendingIn progressin_progressliveEndedendedLoaded content is read-onlyExpired before startexpiredLoaded content is read-onlyClient exit and cleanupleaveClassroom() leaves for the current userdestroy() releases the current SDK instanceStartEndExpires before start
The server determines class state. ended means the class has ended; expired means it expired before starting. A client leaving does not end the class for everyone.
Classroom state transitions

Swipe horizontally to see the full diagram

Classroom state transitionsThe server determines class state. ended means the class has ended; expired means it expired before starting. A client leaving does not end the class for everyone.Not startednot_startedcreating / pendingIn progressin_progressliveEndedendedLoaded content is read-onlyExpired before startexpiredLoaded content is read-onlyClient exit and cleanupleaveClassroom() leaves for the current userdestroy() releases the current SDK instanceStartEndExpires before start

The server determines class state. ended means the class has ended; expired means it expired before starting. A client leaving does not end the class for everyone.

Classroom business state​

Client lifecycleStatusBackend statusMeaning
not_startedcreating / pendingCreated, not yet started
in_progressliveStarted; actions still depend on role, permissions and stage state
endedendedNormally ended; loaded content is read-only
expiredexpiredExpired without a normal start; loaded content is read-only

Read the server-determined classroom state through getClassInfo().lifecycleStatus. ended means a class has ended; expired means it expired before starting. Scheduled times do not directly determine client state.

startsAt / endsAt describe the schedule; actualStartedAt / endedAt describe actual transitions. effectiveEndsAt incorporates the actual start, duration and overtime. The SDK supplies timerMode (hidden, countdown, elapsed) and timerSeconds; the UI formats them.

Client connection stages​

Entry readiness and media connections

Swipe horizontally to see the full diagram

Entry readiness and media connectionsonJoinSuccess follows backend and IM readiness. RTC and whiteboard report separately through onJoinProgress. Backend or IM failure rolls back entry. This flow requires matching session-control source builds.Join via sdk-apiAuthentication and class configReceive init and credentialsIM readyLogin · Confirm class groupSession ready · Member snapshotonJoinSuccessRequired backend and IM readyRTC / Whiteboard initEnabled by init configurationConnect independentlyonJoinProgressReport each capability stateReady / FailedConnect by capability
onJoinSuccess follows backend and IM readiness. RTC and whiteboard report separately through onJoinProgress. Backend or IM failure rolls back entry. This flow requires matching session-control source builds.
Entry readiness and media connections

Swipe horizontally to see the full diagram

Entry readiness and media connectionsonJoinSuccess follows backend and IM readiness. RTC and whiteboard report separately through onJoinProgress. Backend or IM failure rolls back entry. This flow requires matching session-control source builds.Join via sdk-apiAuthentication and class configReceive init and credentialsIM readyLogin · Confirm class groupSession ready · Member snapshotonJoinSuccessRequired backend and IM readyRTC / Whiteboard initEnabled by init configurationConnect independentlyonJoinProgressReport each capability stateReady / FailedConnect by capability

onJoinSuccess follows backend and IM readiness. RTC and whiteboard report separately through onJoinProgress. Backend or IM failure rolls back entry. This flow requires matching session-control source builds.

With a classroom ID and user token configured, the SDK enters in this order:

  1. SDK sends POST /v1/classrooms/join.
  2. It initializes IM, whiteboard and RTC according to init, using separate response credentials.
  3. After IM login and classroom-group confirmation, it completes session ready and reads the member snapshot.
  4. Required backend and IM readiness triggers onJoinSuccess.
  5. Whiteboard and RTC continue reporting domain state through onJoinProgress.

Backend or IM failure rolls entry back. Whiteboard or RTC failure marks the affected capability failed while allowing other UI to continue. HTTP 200 or command acceptance does not replace readiness events.

Ending and leaving​

endClass() / server classrooms.end() end the class for everyone. leaveClassroom() exits the current user; destroy() releases the SDK instance. Do not unconditionally end class when closing a page.

Device changes depend on user action and effective permission. A teacher can request that a user open a device but cannot bypass user/OS authorization. Use onStreamInfoChanged for actual state.

Reconnection​

Recovery reads authoritative server snapshots and handles IM signal ordering. Hosts do not duplicate join HTTP or construct session-control requests. Custom whiteboards should reload synchronization in response to onWhiteboardRecoveryRequested and related events; UI Kit connects these hooks.

This connection flow requires matching session-control server and client source builds. For the published client 0.1.1 packages, see protocol compatibility.