googlearchive/android-Camera2Video

How to open flash light

Closed this issue · 3 comments

I want to open flash light when opening a back camera. so how i can open flash light??

By setting torch mode in the parameters.

@afollestad I tried using the following code reported below under the start recording fcn (line 622), but it is not working (although the same procedure was working in another app)? Would you mind helping me, please? Thank you!

mPreviewBuilder.set(CaptureRequest.CONTROL_AE_MODE,

 CaptureRequest.CONTROL_AE_MODE_ON);
    mPreviewBuilder.set(CaptureRequest.FLASH_MODE,CaptureRequest.FLASH_MODE_TORCH);
   
   try {

                mPreviewSession.setRepeatingRequest(mPreviewBuilder.build(), mRecordCaptureCallback, mBackgroundHandler);

            } catch (CameraAccessException e) {
                e.printStackTrace();
            }

This sample has been migrated to a new location where we can accept Pull Requests (check README for more information).

As recommended by GitHub, we are closing all issues and pull requests now that this older repo will be archived.

If you still see this issue in the updated repo, please reopen the issue/PR there. Thank you!