Video Device Management

Update time: 2025/06/11 16:45:39

The NERTC SDK supports the setting of camera-related parameters and configurations on mobile devices, and provides the video device testing methods before entering the room at the Web side.

Camera management

In using video in various business scenarios, users often need to adjust the device camera in terms of exposure, focus, and flashlight settings so that the image of the subject is clear and presents appropriate brightness. The NERTC SDK provides a complete set of camera management methods on the mobile platform, by which users can flexibly switch between the front and rear cameras, and perform related configurations to the camera like zooming, focusing, and exposure.

The NERTC SDK also provides related APIs on the mobile platform, which are helpful to detect the device capabilities related to video shooting, such as detecting whether the flashlight is can be forced on. In addition, multiple camera-related setting methods are supported, including:

  • Flashlight: Flashlight on/off.
  • Focus: Manual focusing.
  • Exposure: Manual selection of exposure area and automatic exposure.
  • Camera-related:
    • Zooming: Dynamic adjustment of zooming ratio.
    • Camera switching: Switching between front and rear cameras.

Considerations

  • The maximum zooming ratio supported by the current camera is provided by the bottom API of the device. This value may be very high, and if so, the image may be blurred. Users should set the corresponding zooming ratio depending on their own needs.
  • The area of the focusing zone should be adjusted according to user's needs. It may affect both metering and focusing.

Method

The NERTC SDK supports the following advanced camera functions:

  • Switching cameras

    You can call switchCamera to switch between the front and rear cameras at any time, even during a call.

  • Turning on/off the flashlight

    1. You can call isCameraTorchSupported to check whether the device supports to keep the flashlight to be forced on.
    2. You can call setCameraTorchOn to turn on/off the flashlight at any time, even during a call.
  • Setting camera zooming ratio

    1. You can call isCameraZoomSupported to check whether the device supports camera zooming.
    2. You can call the getCameraMaxZoom method to obtain the maximum zooming ratio supported by the device, and call getCameraCurrentZoom to obtain the current zooming ratio of the camera.
    3. You can call setCameraZoomFactor to set the specific zooming ratio required, which can be dynamically adjusted during a call.
  • Implementing manual focusing function

    1. You can call isCameraFocusSupported to check whether the device supports manual focusing.
    2. You can call setCameraFocusPosition method to set the manual focusing position and trigger the focusing.
  • Implementing manual exposure function

    1. You can call isCameraExposurePositionSupported to check whether the device supports the manual exposure function.
    2. You can call setCameraExposurePosition to set the manual exposure position.

Sample code

java    // Switch between front and rear cameras.
    NERtcEx.getInstance().switchCamera();
    
    // Turn on/off the flashlight.
    boolean cameraFlashOn = true;
    NERtcEx.getInstance().setCameraTorchOn(cameraFlashOn);
    
    // Set the camera zooming ratio.
    int curZoom = NERtcEx.getInstance().getCameraCurrentZoom();
    NERtcEx.getInstance().setCameraZoomFactor(curZoom + 2); //Zoom in
    NERtcEx.getInstance().setCameraZoomFactor(curZoom - 2); //Zoom out
    
    // Implement the manual focusing function.
    if(event.getAction() == MotionEvent.ACTION_UP){
        NERtcEx.getInstance().setCameraFocusPosition(event.getX(),event.getY());
    }    
Was this page helpful?
Yes
No
  • Camera management
  • Considerations
  • Method
  • Sample code