Switch camera (back and front)

0 votes
asked Jan 16, 2018 by m3night (930 points)

Hi albert,

I am using piece of code to switch cameras dynamically but this error happens

ARBuilder.Instance.CameraDeviceBehaviours [0].CameraDeviceType = CameraDevice.Device.Front;

`EasyAR.CameraDevice' is inaccessible due to its protection level

The code is provided in easyar unity document here:

https://www.easyar.com/doc_sdk/en/Reference/Unity/Unity-CameraDeviceBaseBehaviour.html#OpenAndStart

Thanks,

mark

1 Answer

0 votes
answered Jan 16, 2018 by m3night (930 points)

Sorry, I found the answer. The document was not updated in the link specified.

I had to change from

CameraDevice.Device.Front

To

CameraDeviceBaseBehaviour.DeviceType.Front
commented Apr 20, 2019 by samilapf (100 points)
Hello Mark,

By chance do you have the code to access front camera using easyAR in unity?

Thanks a lot!
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...