title: Android - Switch between front and back camera while recording a video
body: <p>I am trying to implement Custom Camera to record a video. I have followed <a href="https://github.com/googlesamples/android-Camera2Video" rel="noreferrer">This sample</a> and it is working fine.</p>
  
  <p>Now, i want to add <strong>"Switch Camera"</strong> functionality over a Button click. It should be able to <strong>Switch between Front/Back Camera</strong> even while the video is getting recorded.</p>
  
  <p>Hence please help me to know if it is even possible??</p>
  
  <p><strong>1. If yes then How??</strong></p>
  
  <p><strong>2. If no then Please suggest some workaround??</strong></p>
  
  <p>Some sample codes or links would be very helpful...</p>
  
  <p><strong>Note :</strong> I have been googling about it and found some StackOverFlow answers like </p>
  
  <p><a href="https://stackoverflow.com/questions/39022845/android-camera2-api-switch-back-front-cameras">Android Camera2 API switch back - front cameras</a></p>
  
  <p><a href="https://stackoverflow.com/questions/16765527/android-switch-camera-when-button-clicked">Android: Switch camera when button clicked</a></p>
  
  <p>But none of these are giving a <strong>facility to switch the camera when the video is being recorded</strong>.</p>
  
  <p><strong>Please Help.</strong> </p>
  
  <p>The code is same as <a href="https://github.com/googlesamples/android-Camera2Video" rel="noreferrer">This sample</a>. And it's the <strong>Camera2 API</strong>.</p>