setDualStreamMode abstract method

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

Sets the dual-stream mode on the sender and configures the low-quality video stream.

The SDK enables the adaptive low-quality stream mode (autoSimulcastStream) by default on the sender, meaning the sender does not actively send low-quality streams. Receivers with host roles can call setRemoteVideoStreamType to request low-quality streams. After receiving the request, the sender automatically starts sending low-quality streams. If you want to change this behavior, you can call this method and set mode to disableSimulcastStream (never send low-quality streams) or enableSimulcastStream (always send low-quality streams). If you want to revert to the default behavior after modification, call this method again and set mode to autoSimulcastStream. The differences and relationships between this method and enableDualStreamMode are as follows: Calling this method and setting mode to disableSimulcastStream has the same effect as calling enableDualStreamMode with enabled set to false. Calling this method and setting mode to enableSimulcastStream has the same effect as calling enableDualStreamMode with enabled set to true. Both methods can be called before or after joining a channel. If both are used, the settings in the later call take effect.

  • mode The mode for sending video streams. See SimulcastStreamMode.
  • streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When mode is set to disableSimulcastStream, setting streamConfig has no 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. See Error Codes for details and resolution suggestions.

Implementation

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