title: Cordova android app with image overlay over video camera
body: <p>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:</p>
  
  <pre><code>Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
  this.cordova.startActivityForResult((CordovaPlugin) this, intent, CAPTURE_VIDEO);
  </code></pre>
  
  <p><a href="https://github.com/apache/cordova-plugin-media-capture/blob/master/src/android/Capture.java" rel="nofollow">https://github.com/apache/cordova-plugin-media-capture/blob/master/src/android/Capture.java</a></p>
  
  <p>This opens the native Camera in a totally separate window out of control of my plugin, which prevents me adding an overlay button. </p>
  
  <p>There are a couple of plugins which use more custom code to invoke the Video camera:</p>
  
  <pre><code>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();
  </code></pre>
  
  <p><a href="https://github.com/jamesla/backgroundvideo/blob/master/src/android/VideoOverlay.java" rel="nofollow">https://github.com/jamesla/backgroundvideo/blob/master/src/android/VideoOverlay.java</a></p>
  
  <p>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.</p>
  
  <p>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?</p>