I'm adjusting the Java of a Cordova plugin which records video fine, but the client has requested to force the torch on, but what I have attempted isn't working, if someone can steer me in the right direction:
private void captureVideo(int duration, boolean highquality, boolean frontcamera) {
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
String videoUri = getVideoContentUriFromFilePath(this.cordova.getActivity(), getTempDirectoryPath());
intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
intent.putExtra("android.intent.extra.videoQuality", 0);
// Added this line
intent.putExtra("android.intent.extra.FLASH_MODE_ON", 1);
if (Build.VERSION.SDK_INT > 7) {
intent.putExtra("android.intent.extra.durationLimit", duration);
}
this.cordova.startActivityForResult(this, intent, CAPTURE_VIDEO);
}