目录

How do I set the camera focal length?

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

Reference

getZoomRatioRange, setZoomRatio