CameraDeepAR icon indicating copy to clipboard operation
CameraDeepAR copied to clipboard

Unable to switch CameraDirection back

Open Hi99simon opened this issue 3 years ago • 3 comments

We are able to switch camera direction to Front camera. However, not able to switch backward.

deepArController.switchCameraDirection(direction: CameraDirection.back);

this doesn't work.

Hi99simon avatar Jan 28 '22 04:01 Hi99simon

@Hi99simon This is what I am using to switch the camera:

cameraDirection =
                              cameraDirection == CameraDirection.front
                                  ? CameraDirection.back
                                  : CameraDirection.front;
                          _cameraDeepArController.switchCameraDirection(
                              direction: cameraDirection);

rlee1990 avatar Jan 28 '22 20:01 rlee1990

Wrap that into setState also

rlee1990 avatar Jan 28 '22 20:01 rlee1990

Thanks! I missed the setState. It is important to point it out. Thanks ;)

Hi99simon avatar Jan 29 '22 02:01 Hi99simon