enableTrafficControl method

Future<void> enableTrafficControl(
  1. bool enable,
  2. int property,
  3. {ZegoPublishChannel? channel}
)

Enables or disables the traffic control for the specified publish channel.

Available since: 1.5.0 Description: Enabling traffic control allows the SDK to adjust the audio and video streaming bitrate according to the current upstream network environment conditions, or according to the counterpart's downstream network environment conditions in a one-to-one interactive scenario, to ensure smooth results. At the same time, you can further specify the attributes of traffic control to adjust the corresponding control strategy. Default value: Enable. When to call: After the engine is created createEngine, Called before startPublishingStream can take effect. Restrictions: Only support RTC publish.

  • enable Whether to enable traffic control. The default is ture.
  • property Adjustable property of traffic control, bitmask format. Should be one or the combinations of ZegoTrafficControlProperty enumeration. AdaptiveFPS as default.
  • channel Publish stream channel.

Implementation

Future<void> enableTrafficControl(bool enable, int property,
    {ZegoPublishChannel? channel}) async {
  return await ZegoExpressImpl.instance
      .enableTrafficControl(enable, property, channel: channel);
}