I'm building a hybrid app which needs to have a custom button on top of the camera view (maintaining the existing camera controls). I've previously done this before in iOS and was fairly straightforward. However most Android plugins use the 'intent' method:
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
this.cordova.startActivityForResult((CordovaPlugin) this, intent, CAPTURE_VIDEO);
https://github.com/apache/cordova-plugin-media-capture/blob/master/src/android/Capture.java
This opens the native Camera in a totally separate window out of control of my plugin, which prevents me adding an overlay button.
There are a couple of plugins which use more custom code to invoke the Video camera:
recorder = new MediaRecorder();
recorder.setCamera(camera);
recorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
setProfile(recorder, cameraParameters);
recorder.setOutputFile(filePath);
recorder.setOrientationHint(90);
preview.attach(recorder);
recorder.prepare();
recorder.start();
https://github.com/jamesla/backgroundvideo/blob/master/src/android/VideoOverlay.java
However these plugins are very buggy, and remove a lot of the Camera controls I was planning to rely on: start/stop/preview and accept buttons.
Is there a solution in the middle where I don't need to totally re-write the camera buttons from scratch, I can keep the existing buttons, but add an overlay?