Skip to content

Advanced Camera APIs

Rohit Sharma edited this page Apr 10, 2023 · 2 revisions

Why do we need Camera APIs?

These APIs let the user play around with the system camera of the device. Users can manipulate the exposure values, set zoom factor, use the camera flash, and much more.

NOTE: This feature is only available after sdk-version 3.3.0-SNAPSHOT

1. setCameraTorchMode(mode: TorchMode)

This API lets the user enable, disable or auto-enable the camera torch of the phone. This API only works with the rear camera of the device.

2. setCameraFlashMode(mode: FlashMode)

This API lets the user enable, disable or auto-enable the camera flash of the phone and will be triggered at the time of takePhoto() API.

3. setVideoZoomFactor(factor: Float)

This lets the user zoom in or out depending upon the device's capability.

4. getCameraExposureDuration(): CameraExposureDuration

This API will give the min, max range as well as the current value of the camera exposure duration. The default value until it is set is 0.

5. getCameraExposureISO(): CameraExposureISO

This API will give the min, max range as well as the current value of the camera exposure ISO. The default value until it is set is 0.

6. getCameraExposureTargetBias(): CameraExposureTargetBias

This API will give the min, max range as well as the current value of the camera target bias. The default value until it is set is 0.

7. setCameraFocusAtPoint(pointX: Float, pointY: Float)

This API lets the user to focus the camera at a particular point.

8. setCameraCustomExposure(duration: Double, iso: Float)

This API takes in exposure duration and exposure ISO value to custom adjust the exposure. Exposure duration determines the amount of time your film is exposed to light when taking a photograph. ISO is your camera's sensitivity to light as it pertains to either film or a digital sensor. A lower ISO value means less sensitivity to light, while a higher ISO means more sensitivity.

9. setCameraAutoExposure(targetBias: Float)

This API takes in Target bias to auto-adjust the exposure. Target bias is set to make a scene brighter, move the camera, and exposure will keep adjusting to keep that level of enhanced brightness.

10. takePhoto()

This API lets you click the photo of the local view. The result is obtained as Data in

fun onPhotoCaptured(imageData: ByteArray?)


Steps to use Camera APIs

  1. First the user needs to be on a call, whether 1-1 or a meeting.
  2. The user needs to enable the local camera view to use camera APIs.
  3. Call the desired camera API.

Clone this wiki locally