1

i use this method to record video from front camera: Recording video via Mediarecorder

it works fine in my Nexus 4 but some people says that there is a lot of phones that their front camera cant record video and they only can take pictures. My Android App functionality based on recording video from front camera and my question is that is this true that some phones can't record video via front camera? and how i can detect this and inform user?

Community
  • 1
  • 1
Fcoder
  • 9,066
  • 17
  • 63
  • 100
  • Generally speaking, the purpose of the front-facing camera is for video chat. It's usually lower quality (and less expensive) than the rear-facing camera, which is expected to be used for both photos and video. So it doesn't really make sense for the front-facing camera to only do still images. – fadden Aug 02 '14 at 14:18

1 Answers1

1

Try calling some code like this

    CameraInfo cameraInfo = new CameraInfo();
    if (cameraInfo.facing = CameraInfo.CAMERA_FACING_FRONT) {
     //do your code?
    } else {
//alert the user via toast or dialog
}

no built in way to figure it out though.

EDIT: should work on API 9 and above.

maybe try calling these methods to first get a camera object, then check to see if there is a camcorderProfile available for the front facing camera?

   hasProfile (int cameraId, int quality)
   setCamera(camera);
reidisaki
  • 1,525
  • 16
  • 29
  • this code checks if device has front camera or not. but some devices has front camera and cant record video... – Fcoder Aug 01 '14 at 17:58