startCloudProxy method

Future<int?> startCloudProxy(
  1. List<CloudProxyInfo> cloudProxiesInfo
)

@detail api @author daining.nemo @brief 开启云代理 @param cloudProxiesInfo 云代理服务器信息列表。参看 CloudProxyInfo{@link #CloudProxyInfo}。 @return - 0: 调用成功。 - < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明 @note - 在加入房间前调用此接口 - 在开启云代理后,进行通话前网络探测 - 开启云代理后,并成功链接云代理服务器后,会收到 onCloudProxyConnected{@link #IRTCEngineEventHandler#onCloudProxyConnected}。 - 要关闭云代理,调用 stopCloudProxy{@link #RTCEngine#stopCloudProxy}。

Implementation

Future<int?> startCloudProxy(List<CloudProxyInfo> cloudProxiesInfo) async {
  $a() => ($instance as $p_a.RTCEngine).startCloudProxy(cloudProxiesInfo
      .map(($item) => unpackObject<$p_a.CloudProxyInfo>($item))
      .toList());
  $i() => ($instance as $p_i.ByteRTCEngine).startCloudProxy(cloudProxiesInfo
      .map(($item) => unpackObject<$p_i.ByteRTCCloudProxyInfo>($item))
      .toList());

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}