Search code examples
quickblox

Flashlight implementation within Android SDK


By default the flashlight is not employed while video-calling. Need the flashlight to be turning on automatically once the video call starts till the end.


Solution

  • The flashlight is turned on using the following method:

    ・cameraManager.setTorchMode(cameraId, true);

    ・This was done using the steps described in the URL: https://medium.com/@ssaurel/create-a-torch-flashlight-application-for-android-c0b6951855c

    For reference, here is the URL which explains the method described above: https://developer.android.com/reference/android/hardware/camera/CameraManager#setTorchMode(java.lang.String,boolean)