@Kroll.method public void switchCamera(int whichCamera) { TiCameraActivity activity = TiCameraActivity.cameraActivity; if (activity == null || !activity.isPreviewRunning()) { Log.e(TAG, "Camera preview is not open, unable to switch camera."); return; } activity.switchCamera(whichCamera); }
@Kroll.method public void takePicture() { // make sure the preview / camera are open before trying to take photo if (TiCameraActivity.cameraActivity != null) { TiCameraActivity.takePicture(); } else { Log.e(TAG, "Camera preview is not open, unable to take photo"); } }
@Kroll.method public void hideCamera() { // make sure the preview / camera are open before trying to hide if (TiCameraActivity.cameraActivity != null) { TiCameraActivity.hide(); } else { Log.e(TAG, "Camera preview is not open, unable to hide"); } }