Open OscarIT opened 10 years ago
I don't quite follow, do you mean capture an image x milliseconds/seconds after the user has tapped the capture button? Or capture the image x milliseconds/seconds after the camera preview is shown?
Im searching for a an Android phonegap plugin to take a photo directly, with no user action needed. I want to avoid the camera interface totally, to capture a photo, create timelapses, etc.
There are a few plugins for iOS, but cant find one for Android: http://codrspace.com/vote539/writing-a-custom-camera-plugin-for-phonegap/
I saw at your code there is a Takepicture action, is it possible to access it from the javascript code? It would be a nice feature.
customCamera.getPicture(...) can be called from javascript but it will open a camera preview and remain open until the user taps the capture button.
Sorry, I mean these 2 functions:
You could probably re-use some of the code but the CustomCameraActivity will always display the camera preview when created.
We need this feature too. i've forked official cordova camera plugin, and add some new code to android platform. it works without cordova, we have tested itself as an android newproject, but can't make it work with cordova.
class MyThread extends Thread {
public void run() {
// test
try {
Thread.sleep(Timer);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
camera.autoFocus(new AutoFocusCallback() {// autofocus
public void onAutoFocus(boolean success, Camera camera) {
Parameters params = camera.getParameters();
params.setPictureFormat(PixelFormat.JPEG);// format
params.setPreviewSize(800, 480);// width & height
camera.setParameters(params);// set parameters
camera.takePicture(null, null, jpeg);// take photo.
}
});
}
}
Someone tried this ?
Hello there.. I need to capture an image x every 30 seconds after the user has tapped the capture button! Can any one help me with that?
Can we attach a timeout click event to take the picture without user action?