Friday, August 18, 2017

How to restrict the plugin to switch rear/back camera in android / cordova

Leave a Comment

I am using media-capture plugin of cordova to capture the video only from front camera. when it opens the camera, there is option to switch the back or rear camera, can anyone please guide, how to disable switching to back camera. I have done following modification in plugin and re added to app, but no luck.

intent.putExtra("android.intent.extras.LENS_FACING_BACK", 0); intent.putExtra("android.intent.extra.USE_BACK_CAMERA", false); 

1 Answers

Answers 1

Try this instead:

intent.putExtra("android.intent.extras.CAMERA_FACING", 1);


https://developer.android.com/reference/android/hardware/Camera.CameraInfo.html

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment