1

I have some code on the following link to record the video How can I capture a video recording on Android?

it works fine but I want to start preview my camera before start the recording. I have try to add the

recorder.setCamera(Camera.open());

but it doesn't work. Please suggest me what should I add for start preview before recording.

regards

Community
  • 1
  • 1
NBS
  • 11
  • 1
  • 2

1 Answers1

4

You can use the Camera object to start the preview and then stop it before using the MediaRecorder (take a look here to see how to use the camera: Camera Tutorial)

You also have the android camera app in order to see how to combine the Camera API and the MediaRecorder API. It is a great reference for this stuff: Camera App

Justo install git and download the code. You want to look on:

  1. VideoCamera

  2. CameraHandler (or something like this)

Good luck.

Lior Ohana
  • 3,467
  • 4
  • 34
  • 49