The SDK provides a variety of preset scenarios, facilitating your quick and easy access. You can select a room scenario based on your requirements. Then the SDK automatically applies the audio and video codecs, audio and video parameters, network traffic control strategy, and other configurations suitable for the scenario to quickly achieve the best effect. Currently, the SDK supports the following scenarios: live streaming, KTV, standard one-to-one voice and video calls, high-quality one-to-one voice and video calls, standard voice chatroom, and high-quality voice chatroom.
In profile
(ZegoEngineProfile
) used to create an engine, you need to set the scenario
(ZegoScenario
) field to a room scenario based on the audio and video service requirements.
destroyEngine
) to destroy the engine. Instead, you can call setRoomScenario
to switch the scenario after the user logs out of the room.The following table lists the room scenarios that are currently supported by the SDK.
Scenario (supported in 3.0.0 and later versions) | Description | Key configuration |
---|---|---|
Broadcast |
One-to-many live streaming scenarios such as games, e-commerce, and large classes. The quality of sound and picture, fluency, and compatibility are optimized.
Note: Even in live streaming scenarios, the SDK does not differentiate users by role (for example, host or participant), and all users in the same room can publish and play streams. |
|
StandardVideoCall |
Standard one-to-one voice and video call scenario. |
|
HighQualityVideoCall |
High-quality voice and video call scenario. It is similar to the StandardVideoCall scenario but uses a higher video frame rate, bitrate, and resolution by default. It is applicable when high picture quality is required. |
|
StandardChatroom |
Standard voice chatroom scenario, applicable to multi-party voice calls. This scenario features traffic saving.
Note: The ExpressVideo SDK disables the camera for this scenario by default. |
Audio and video codec compatibility: It can be used only for RTC stream publishing. Transcoding is required on the server side if streams need to be forwarded to the CDN. |
HighQualityChatroom |
High-quality voice chatroom scenario. It is similar to the StandardChatroom scenario but uses a higher audio bitrate by default. It is applicable when high sound quality is required during multi-party voice calls. Note: The ExpressVideo SDK disables the camera for this scenario by default. |
Audio and video codec compatibility: It can be used only for RTC stream publishing. Transcoding is required on the server side if streams need to be forwarded to the CDN. |
Karaoke |
KTV scenario, applicable when users need to sing a real-time chorus or online karaoke song. The latency, sound quality, headphone monitoring, and acoustic echo cancellation (AEC) are optimized. The precise alignment and ultra-low time latency during a multi-party chorus are also ensured.
Note: The ExpressVideo SDK disables the camera for this scenario by default. |
Audio and video codec compatibility: It can be used only for RTC stream publishing. Transcoding is required on the server side if streams need to be forwarded to the CDN. |
Default |
Default (general) scenario. You can use this scenario if the preceding enumerated scenarios do not match your requirements. |
|
However, these scenarios have been discarded. Therefore, users must migrate to the scenarios in the new version as soon as possible.
After specifying a scenario, you can call the following methods of the SDK to adjust audio and video service configurations. For details, see Common video configuration and Network traffic control.
Video-related methods
enableCamera
setVideoConfig
enableHardwareEncoder
enableHardwareDecoder
Audio-related methods
setAudioConfig
setAudioDeviceMode
AGC, AEC, and ANS–related methods
enableAGC
enableAEC
setAECMode
enableANS
setANSMode
Network traffic control–related methods
enableTrafficControl
setMinVideoBitrateForTrafficControl
setMinVideoFpsForTrafficControl
setMinVideoResolutionForTrafficControl
setRoomScenario
is invalid and onDebugError
will be triggered to return error code 1000067.setRoomScenario
, all audio and video service configurations that are adjusted using the preceding methods will be reset to the default of the new scenario. Therefore, you are advised to configure a scenario before adjusting audio and video service configurations.