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