Reputation: 3059
I want to capture video without showing a preview. The android docs here say this is possible, but don't explain how:
http://developer.android.com/guide/topics/media/camera.html#capture-video
Note: It is possible to use MediaRecorder without creating a camera preview first and skip the first few steps of this process. However, since users typically prefer to see a preview before starting a recording, that process is not discussed here.
what are the "first few steps" to skip?
Thank you
Upvotes: 2
Views: 5628
Reputation: 57203
You misinterpret the documentation. What it really says (emphasis mine):
It is possible to use MediaRecorder without creating a camera preview first and skip the first few steps of this process. However, since users typically prefer to see a preview before starting a recording, that process is not discussed here.
In other words, you can create a preview and immediately start recording. There is no hint that MediaRecorder will let you run a hidden recording session.
Moreover, I agree with the document that the added value of not starting preview before starting recording, is negligible.
Upvotes: 2
Reputation: 4036
Even though the documentation states it is possible, most of SO answers say otherwise. Take a look at this answer (and the answers linked in it).
The work around this limitation is to create a 1 x 1 px SurfaceView
and use it to display the camera preview.
Upvotes: 0
Reputation: 206
You can just skip step 5 of configuring media recorder given in the above link and preview wont be shown. But user will be interested in viewing its preview.
Upvotes: 1