setCameraZoomRatio method
@detail api
@author zhangzhenyu.samuel
@brief Change the optical zoom magnification.
@param zoom Zoom magnification of the currently used camera (front/postcondition). The value range is 1, < Maximum Zoom Multiplier >.
The maximum zoom factor can be obtained by calling getCameraZoomMaxRatio{@link #RTCEngine#getCameraZoomMaxRatio}.
@return
- 0: Success.
- < 0: Failure. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- The camera zoom factor can only be set when startVideoCapture{@link #RTCEngine#startVideoCapture} is called for video capture using the SDK internal capture module.
- The setting result fails after calling stopVideoCapture{@link #RTCEngine#stopVideoCapture} to turn off internal collection.
- Call setVideoDigitalZoomConfig{@link #RTCEngine#setVideoDigitalZoomConfig} to set digital zoom. Call setVideoDigitalZoomControl{@link #RTCEngine#setVideoDigitalZoomControl} to perform digital zoom.
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}');
}
}