Enable and disable the whiteboard
The whiteboard module in Flexible Classroom is implemented based on AgoraWidget
. You can turn the whiteboard module on or off in the classroom by setting the widget state as active or inactive.
After disabling the whiteboard module, drawing tools including pencil, text box, shape, and eraser will no longer be available and users cannot upload, delete, or display class files on the whiteboard. Other features that do not rely on the whiteboard, such as uploading or deleting class files, pop-up quiz, count-down timer, and screen sharing will not be affected.
Turn the whiteboard on or off
The Whiteboard interface is packaged in the file packages/agora-classroom-sdk/src/infra/stores/common/base.ts
, and the whiteboard-related interface is in the file packages/agora-classroom-sdk/src/infra/protocol/board.ts
.
To enable or disable the Whiteboard, you monitor the status change of the Whiteboard caused by the teacher client and adjust the UI accordingly.
Call the Whiteboard-related interfaces boardApi.enable()
and boardApi.disable()
to turn the Whiteboard on or off.
API reference
connected
Query whether the Whiteboard is connected to the server.
return value
true
: connected.false
: not connected.
mounted
Query whether the Whiteboard is mounted.
return value
true
: Mounted.false
: not mounted.
granted
Query whether the user has the permission to operate the Whiteboard.
return value
true
: Have permission.false
: No permission.
enable
Connect and turn on the Whiteboard.
disable
Disconnect and turn off the Whiteboard.