1

I'm using cwac-camera lib for my android camera application. the purpose for this camera is to record video. this video camera has features like a normal video camera like toggling Flash on/off before video recording. but the problem is, I'm having trouble implementing the FLASH_MODE_TORCH. I want is to turn on FLASH_MODE_TORCH during preview and if i start recording the flash is still present.

here's the code.

@Override
public Camera.Parameters adjustPreviewParameters(Camera.Parameters parameters){    
                if (vidFlash) {
                    parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);

                } else {
                    parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
                }

                return super.adjustPreviewParameters(parameters);
            }

this was my first attempt, the FLASH_MODE_TORCH will occur when I start the application all I need is to toggle this on or off so that's why I used the code above

@Override
public Camera.Parameters adjustPreviewParameters(Camera.Parameters parameters) {
            parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);

            return super.adjustPreviewParameters(parameters);
        }
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491

1 Answers1

0

Sorry, but there is no way with the CWAC-Camera API to accomplish this directly.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491