enablePublishDirectToCDN method

Future<void> enablePublishDirectToCDN(
  1. bool enable,
  2. {ZegoCDNConfig? config,
  3. ZegoPublishChannel? channel}
)

Whether to directly push to CDN (without going through the ZEGO RTC server), for the specified channel.

Available since: 1.5.0 Description: Whether to publish streams directly from the client to CDN without passing through Zego RTC server. Use cases: It is often used in large-scale live broadcast scenes that do not have particularly high requirements for delay. Default value: The default is false, and direct push is not enabled. When to call: After creating the engine createEngine, before starting to push the stream startPublishingStream. Caution: The Direct Push CDN feature does not pass through the ZEGO Real-Time Audio and Video Cloud during network transmission, so you cannot use ZEGO's ultra-low latency audio and video services. Related APIs: Dynamic re-push to CDN function addPublishCdnUrl, removePublishCdnUrl.

  • enable Whether to enable direct publish CDN, true: enable direct publish CDN, false: disable direct publish CDN.
  • config CDN configuration, if null, use Zego's background default configuration.
  • channel Publish stream channel.

Implementation

Future<void> enablePublishDirectToCDN(bool enable,
    {ZegoCDNConfig? config, ZegoPublishChannel? channel}) async {
  return await ZegoExpressImpl.instance
      .enablePublishDirectToCDN(enable, config: config, channel: channel);
}