setDualStreamMode abstract method

Future<void> setDualStreamMode({
  1. required SimulcastStreamMode mode,
  2. SimulcastStreamConfig? streamConfig,
})

Sets dual-stream mode configuration on the sender side.

The SDK defaults to enabling low-quality video stream adaptive mode (autoSimulcastStream) on the sender side, which means the sender does not actively send low-quality video stream. The receiving end with the role of the host can initiate a low-quality video stream request by calling setRemoteVideoStreamType, and upon receiving the request, the sending end automatically starts sending low-quality stream. If you want to modify this behavior, you can call this method and set mode to disableSimulcastStream (never send low-quality video streams) or enableSimulcastStream (always send low-quality video streams). If you want to restore the default behavior after making changes, you can call this method again with mode set to autoSimulcastStream. The difference and connection between this method and enableDualStreamMode is as follows: When calling this method and setting mode to disableSimulcastStream, it has the same effect as calling enableDualStreamMode and setting enabled to false. When calling this method and setting mode to enableSimulcastStream, it has the same effect as calling enableDualStreamMode and setting enabled to true. Both methods can be called before and after joining a channel. If both methods are used, the settings in the method called later takes precedence.

  • mode The mode in which the video stream is sent. See SimulcastStreamMode.
  • streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When setting mode to disableSimulcastStream, setting streamConfig will not take effect.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> setDualStreamMode(
    {required SimulcastStreamMode mode, SimulcastStreamConfig? streamConfig});