setCameraZoomRatio method

Future<int?> setCameraZoomRatio(
  1. float zoom
)

@detail api @author zhangzhenyu.samuel @brief 设置当前使用的摄像头(前置/后置)的光学变焦倍数 @param zoom 变焦倍数。取值范围是 1, <最大变焦倍数>
最大变焦倍数可以通过调用 getCameraZoomMaxRatio{@link #RTCEngine#getCameraZoomMaxRatio} 获取。 @return - 0: 成功。 - < 0: 失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明。 @note - 必须已调用 startVideoCapture{@link #RTCEngine#startVideoCapture} 使用 SDK 内部采集模块进行视频采集时,才能设置摄像头变焦倍数。 - 设置结果在调用 stopVideoCapture{@link #RTCEngine#stopVideoCapture} 关闭内部采集后失效。 - 你可以调用 setVideoDigitalZoomConfig{@link #RTCEngine#setVideoDigitalZoomConfig} 设置数码变焦参数, 调用 setVideoDigitalZoomControl{@link #RTCEngine#setVideoDigitalZoomControl} 进行数码变焦。

Implementation

Future<int?> setCameraZoomRatio(float zoom) async {
  $a() => ($instance as $p_a.RTCEngine).setCameraZoomRatio(zoom);
  $i() => ($instance as $p_i.ByteRTCEngine).setCameraZoomRatio(zoom);

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