Agora works hard on improving the video experience in a video call or live streaming by ensuring both the clarity and smoothness of video images. However, under poor network conditions, we usually have to choose between clarity and smoothness.
The requirement for video varies in different scenarios:
Based on these requirements, the Agora Web SDK supports the following two transmission optimization strategies:
When calling createCameraVideoTrack
, createCustomVideoTrack
, or createScreenVideoTrack
, you can choose whether to prioritize video quality or smoothness by setting optimizationMode
as the following:
"detail"
: Prioritizes video quality."motion"
: Prioritizes video smoothness.If you leave this parameter empty, the SDK uses the default transmission optimization strategy:
setOptimizationMode
to dynamically change the optimization mode. For example, during the screen sharing, before you change the shared content from slides to a video, you can change the optimization mode from "detail"
to "motion"
to ensure smoothness in poor network conditions.During a video call, a live streaming or screen sharing, you can call setOptimizationMode
to dynamically change the optimization mode. For example, during the screen sharing, before you change the shared content from text to video, you can change the optimization mode from "detail"
to "motion"
to ensure smoothness in poor network conditions.
Use default transmission optimization strategy
const videoTrack2 = await AgoraRTC.createScreenVideoTrack();
Prioritize video quality
const videoTrack = await AgoraRTC.createCameraVideoTrack({
optimizationMode: "detail",
});
Prioritize video smoothness
const videoTrack2 = await AgoraRTC.createCameraVideoTrack({
optimizationMode: "motion",
});