Proctor SDK
This page provides the TypeScript API reference for the Agora Proctor SDK for Web and Electron.
AgoraProctorSDK
AgoraProctorSDK
is the basic interface of the Agora Proctor SDK and provides the main methods for a flexible classroom in proctoring scenarios.
config
Configures the Agora Proctor SDK.
Parameters
Parameter | Description |
---|---|
config | The configuration for the flexible classroom, see ConfigParams for details. |
launch
Launches a flexible classroom in a proctoring scenario.
Parameters
Parameter | Description |
---|---|
dom | The Document Object Model (DOM). See Document for details. |
option | The classroom launching configuration, see LaunchOption for details. |
Return value
Returns a function used to destroy the scene and recycle resources.
Type Definitions
ConfigParams
The global SDK configuration, used in AgoraProctorSDK.config.
Property | Description |
---|---|
appId | The Agora App ID. See Get the Agora App ID. |
region | (Optional) The region where the classroom is. All clients must use the same region; otherwise, they may fail to communicate with each other. The following regions are supported:
|
LaunchOption
The classroom launching configuration used in AgoraProctorSDK.launch.
Property | Description |
---|---|
userUuid | The user ID. This is the globally unique identifier of a user. This value must be the same as the User ID that you use for generating an RTM token. Refer to the relevant instructions in Integrate Flexible Classroom. This value must be less than 64 bytes. The following characters are supported:
|
userName | The user name for display in the classroom. This value must be less than 64 bytes. |
roomUuid | The room ID. This is the globally unique identifier of a classroom. This value must be less than 64 bytes. The following characters are supported:
|
roleType | The user's role in the classroom. See EduRoleTypeEnum for details. |
roomType | The classroom type. See EduRoomTypeEnum for details. |
roomName | The room name for display in the classroom. The string length must be less than 64 bytes. |
listener | The state of classroom launching.
|
pretest | Whether to enable the pre-class device test:
|
rtmToken | The signaling token used for authentication. For details, see Generate a Signaling Token. |
language | The language on the classroom UI. See LanguageEnum for details. |
startTime | (Optional) The start time (ms) of the class, determined by the first user joining the classroom. |
duration | The duration (seconds) of the class, determined by the first user joining the classroom. The maximum value is 86,400. Agora recommends that you set this value as the actual class duration. |
widgets | (Optional) Extensive widgets that extend the classroom capabilities. See Embed a custom plugin for details. |
userFlexProperties | (Optional) User properties customized by the developer. See How can I set user properties and classroom properties for details. |
mediaOptions | (Optional) Media options, including the media encryption configuration, camera video encoder configuration, and screen sharing video encoder configuration. See LaunchMediaOptions for details. |
latencyLevel | (Optional) The latency level of an audience member. This property does not apply to cohosting users.
|
uiMode | (Optional) The UI theme mode of the classroom. The default value is light , which means a light theme. See FcrMultiThemeMode for details. |
checkStudentScreenShareState | (Optional) Whether to kicks students out of the classroom immediately when they stop screen sharing:
|
rtcCloudProxy | (Optional) The cloud proxy type for the RTC service: AgoraCloudProxyType . |
rtmCloudProxyEnabled | (Optional) Where to enable cloud proxy for the RTM service. |
LaunchMediaOptions
Media options, including the media encryption configuration, camera video encoder configuration, and screen sharing video encoder configuration. Set in LaunchOption.
Property | Description |
---|---|
cameraEncoderConfiguration | (Optional) The encoding configuration of the video stream captured by the camera. See EduVideoEncoderConfiguration for details. |
screenShareEncoderConfiguration | (Optional) The encoding configuration of the screen sharing stream. See EduVideoEncoderConfiguration for details. |
encryptionConfig | (Optional) The media stream encryption configuration. See MediaEncryptionConfig for details. |
channelProfile | The channel profile configuration. See ChannelProfile for details. |
web | The web configuration for browser codec format and channel mode.
|
EduVideoEncoderConfiguration
The video encoder configuration.
Property | Description |
---|---|
dimensionWidth | The width of the video frame in pixels. The default value is 320. |
dimensionHeight | The height of the video frame in pixels. The default value is 240. |
frameRate | The frame rate of the video in FPS. The default value is 15. |
bitRate | The bitrate of the video in Kbps. The default value is 200. |
MediaEncryptionConfig
The media stream encryption configuration used in LaunchMediaOptions.
Property | Description |
---|---|
mode | The encryption mode. See MediaEncryptionMode. Teachers and students in the same classroom must use the same encryption mode and key. |
key | The encryption key. |
ChannelProfile
The channel profiles, used in LaunchMediaOptions.
Value | Description |
---|---|
Communication | Communication mode, commonly used for one-to-one or one-to-many classrooms. |
LiveBroadcasting | Live-streaming mode; this option costs less than communication mode and has a higher latency. |
MediaEncryptionMode
The media stream encryption mode, used in MediaEncryptionConfig.
Value | Description |
---|---|
AES_128_XTS | 128-bit AES encryption, XTS mode. |
AES_128_ECB | 128-bit AES encryption, ECB mode. |
AES_256_XTS | 256-bit AES encryption, XTS mode. |
AES_128_GCM | 128-bit AES encryption, GCM mode. |
AES_256_GCM | 256-bit AES encryption, GCM mode. |
FcrMultiThemeMode
The UI theme mode of the classroom, used in LaunchOption.
Value | Description |
---|---|
light | Light theme. |
dark | Dark theme. |
EduRoleTypeEnum
The role of the user in the classroom, used in LaunchOption.
Value | Description |
---|---|
teacher | 1 : Teacher/Proctor |
student | 2 : Student/Exam taker |
EduRoomTypeEnum
The classroom type, used in LaunchOption.
Value | Description |
---|---|
RoomProctor | 6 : A proctored exam. In proctoring scenarios, roomType can only set as this value. |
LanguageEnum
The language on the UI, used in LaunchOption.
Value | Description |
---|---|
"en" | English |
"zh" | Chinese |
DeviceTypeEnum
Device types.
For more about main devices and supportive devices, see the relevant instructions in Integrate Flexible Classroom.
Value | Description |
---|---|
Main | Main device |
Sub | Supportive device |
AgoraCloudProxyType
The cloud proxy type. Set in LaunchOptions
.
Parameter | Description |
---|---|
Automatic | 0 : The automatic mode. In this mode, the SDK will first attempt to connect directly to SD-RTN™. If the attempt fails, the SDK will automatically fall back to sending media over TLS 443. If you are unsure whether the end user's network environment has a firewall, 'Automatic' mode is recommended as best practice. While transmitting media over TLS 443 may not be as fast and efficient as UDP, connections on TLS 443 can pass through most firewalls. |
UDP | 1 : UDP. |
TCP | 2 : TCP. |