CameraKit / camerakit-android

Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
https://camerakit.io
MIT License
5.36k stars 878 forks source link

Camera Toggle not working #560

Open muhammad-asad-26 opened 5 years ago

muhammad-asad-26 commented 5 years ago

Bug

Hi, We are planning to use CameraKit in one of our applications. We have some initial R&D, the camera switch is not working. Kindly can anyone give us some feedback on it what might be wrong with it.

From the documentation the suggested way is

 if (mCameraKitView.getFacing() == CameraKit.FACING_BACK) {
            mCameraKitView.setFacing(CameraKit.FACING_FRONT);
        } else {
            mCameraKitView.setFacing(CameraKit.FACING_BACK);
        }

also tried

mCameraKitView.toggleFacing();

but nothing seems to work.

Environment

CameraKit Version: com.camerakit:camerakit:1.0.0-beta3.11

Android Device: Huawei Nexus 6P

Android Version: 8.1

Steps to Reproduce

  1. Following getting started (https://camerakit.io/docs#basicusage)
  2. Try to implement the set facing or toggle facing (https://camerakit.io/docs#setfacing, https://camerakit.io/docs#togglefacing)

Expected Behavior

The camera should switch

Actual Behavior

The camera is not switched

yeyupiaoling commented 3 years ago

You can't write it like that : app:camera_facing="back" You should set it in Java code