- Check whether the camera is a front camera. A front camera does not support focal length setting.
- Use getZoomRatioRange to obtain the focal length range supported by the device.
- Check whether the target focal length is within the range obtained. If yes, call setZoomRatio to set the focal length.
Reference
getZoomRatioRange, setZoomRatio