Trying to Turn on Torch while Meeting is on

Description

Hey there,
I just want to turn on torch (flashlight) on android while the camera and meeting is on,
but there is a problem, That I can’t turn on torch because ZoomVideoSdk is using the camera,
So When I get access to the camera and turn on torch, ZoomVideo is revoked from the Camera, and the video stops.

please help me with this problem

Thank you

Which Android Video SDK version?

Zoom Video SDK 1.1.0v

Suggestion

if this feature is not applicable please provide it in the new Releases, just only give access to CameraManger object that ZoomVideoSDK uses

Hi @ibrahim.aljameel, thanks for using our SDK.

I have tried to reproduce the behavior you are describing, but my camera continues working after programmatically turning on the torch. Can you please provide the Android version you are using, device make/model, and a code snippet showing how you are setting the torch mode?

Thanks!

Thanks for your reply,

I test the application on HUAWEI Y9 2019, Android version 9.

I’m trying to turn on torch by writing this code , after the user clicked (OPEN TORCH) button this code execute

        if (isFlashAvailable) {
            try {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                    mCameraManager.setTorchMode("0", true);
                    isFlashOn = true;
                }
            } catch (CameraAccessException e) {
                e.printStackTrace();
            }
        }else{
            //shwoing error that (Device doesn't have torch)
        }

But it shows error that the camera “0” is in use by another user.

if you can help me with the code that worked for you, I’ll appreciate that.
Thank you

Hi @ibrahim.aljameel,

Thanks for the additional context. It seems that there may be an issue with how you are selecting the camera to turn on the torch. Can you verify that you are selecting the correct camera by calling mCameraManager.getCameraIdList() and using an ID from that list instead of a hard-coded value?

Also, how are you determining that the camera is already in use? If there is a specific error you are seeing in the device logs, it would be great if you could provide that as well. :slightly_smiling_face:

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.