This article introduces some best practices for calling an API or setting a parameter while implementing online education use cases.
The online education use case is built on the Agora RTC SDK, RTM SDK, Cloud Recording service, Agora room management system, and Interactive whiteboard SDK.
Refer to the following guides to integrate each SDK or service into your project:
In scenarios with high security requirements, such as online education, Agora recommends every teacher and student test their network and device before a class begins. For details, see Pre-call tests.
Different use cases require different channel profiles. For One-to-one Classroom, call
setChannelProfile and set
COMMUNICATION. For Small Classroom and Lecture Hall, call
setChannelProfile and set
When a local user joins the channel, you need to specify a
UID for them. Agora recommends not setting it as 0, because this causes the SDK to generate a random
UID. This can make it difficult to track issues during troubleshooting.
Ensure that all
UIDs in a channel are different, including the
UID of a recording client, because duplicate
UIDs disconnect each other from the channel.
To enhance communication security, Agora recommends authenticating your users with dynamic tokens and setting the expiration timestamp to a reasonable duration. For how to get and use dynamic tokens, see Set up authentication.
For most online education scenarios, you can use the default audio profile.
In scenarios requiring high audio quality, such as an online music class, Agora recommends calling
setAudioProfile and setting
MUSIC_HIGH_QUALITY (4), and
setVideoEncoderConfiguration to set the video resolution, frame rate, and bitrate, Agora recommends setting them to a reasonable value. High resolution puts pressure on the codec CPU and leads to video freeze, particularly on lower-end devices. On the other hand, high bitrate compromises the uplink and downlink bandwidth. Therefore, under the premise that video quality can be guaranteed, we suggest setting a lower video resolution and bitrate to alleviate resource consumption and the downlink bandwidth.
In a One-to-one Classroom, for example, both the teacher and the student have large windows, requiring high video resolution, frame rate, and bitrate. The recommended video profiles are 240P (320×240, 15 fps, 200 Kbps) or 360P (640×360, 16 fps, 400 Kbps).
In a Small Classroom, both the teacher and the students have smaller windows, and therefore require lower video resolution and bitrate. The recommended video profiles are 120P (160×120, 15 fps, 65 Kbps), 180P (320×180, 15 fps, 140 Kbps), or 240P (320×240, 15 fps, 200 Kbps).
In scenarios where you want to disable the local video but still receive remote video streams, call
enableLocalVideo(false) instead of
muteLocalVideoStream(true). The difference between the two methods is that
enableLocalVideo(false) stops capturing the local video and releases the camera, while
muteLocalVideoStream(true) continues to capture the local video.
You can render the remote video after receiving the
In scenarios involving rotating the video, you can use the
setVideoEncoderConfiguration method. For details, see Set the video profile.
In video scenarios with multiple users, Agora recommends using the dual-stream feature of the RTC SDK. To enable this function, call
enableDualStreamMode from all clients that publish streams, and
setRemoteVideostreamType from all clients that receive streams. For details, see Video for Multiple Users.
Under limited network conditions where guaranteeing both audio and video is not possible, you can call
setRemoteSubscribeFallbackOption to enable the stream fallback function. For details, see Stream fallback.
To ensure user experience, you can monitor the network quality during the class, and report the statistics of the local or remote network quality in the user interface. For details, see In-call stats.
If a user fails to join the channel within 10 seconds, check whether the network environment has a firewall that restricts network access. If so, refer to Firewall Requirements to add firewall whitelist or use Agora cloud proxy.
For questions concerning recording, you can refer to the Cloud Recording FAQ。