setVideoDigitalZoomConfig method

Future<int?> setVideoDigitalZoomConfig({
  1. required ZoomConfigType type,
  2. required float size,
})

@valid since 3.51 @detail api @hiddensdk(audiosdk) @author likai.666 @brief Set the step size for each digital zooming control to the local videos. @param type Required. Identifying which type the size is referring to. Refer to ZoomConfigType{@link #ZoomConfigType}. @param size Required. Reserved to three decimal places. It defaults to 0.
The meaning and range vary from different types. If the scale or moving distance exceeds the range, the limit is taken as the result.
- kZoomFocusOffset: Increasement or decrease to the scaling factor. Range: 0, 7. For example, when it is set to 0.5 and setVideoDigitalZoomControl{@link #RTCEngine#setVideoDigitalZoomControl} is called to zoom in, the scale will increase 0.5. The scale ranges 1,8 and defaults to 1, which means an original size. - kZoomMoveOffset:Ratio of the distance to the border of video images. It ranges 0, 0.5 and defaults to 0, which means no offset. When you call setVideoDigitalZoomControl{@link #RTCEngine#setVideoDigitalZoomControl} and choose CAMERA_MOVE_LEFT, the moving distance is size x original width. While for the CAMERA_MOVE_UP, the moving distance is size x original height. Suppose that a video spans 1080 px and the size is set to 0.5 so that the distance would be 0.5 x 1080 px = 540 px. @return - 0: Success. - < 0: Failure. See ReturnStatus{@link #ReturnStatus} for more details. @note - Only one size can be set for a single call. You must call this API to pass values respectively if you intend to set multiple sizes. - As the default size is 0, you must call this API before performing any digital zoom control by calling setVideoDigitalZoomControl{@link #RTCEngine#setVideoDigitalZoomControl} or startVideoDigitalZoomControl{@link #RTCEngine#startVideoDigitalZoomControl}.

Implementation

Future<int?> setVideoDigitalZoomConfig(
    {required ZoomConfigType type, required float size}) async {
  $a() => ($instance as $p_a.RTCEngine).setVideoDigitalZoomConfig(
      t_ZoomConfigType.code_to_android(type), size);
  $i() => ($instance as $p_i.ByteRTCEngine)
      .setVideoDigitalZoomConfig(t_ZoomConfigType.code_to_ios(type), size);

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