TFClassify-Unity icon indicating copy to clipboard operation
TFClassify-Unity copied to clipboard

Unable to find back camera

Open tomret opened this issue 4 years ago • 3 comments

HI,when i operate the project,the UI show “Unable to find back camera”,please tell me how to fix it?

tomret avatar Mar 12 '20 09:03 tomret

@tomret You can try to use the front camera instead. There is an enumeration of cameras in PhoneCamera.Start method, you can add logs and see what cameras are available on your device.

Syn-McJ avatar Mar 12 '20 09:03 Syn-McJ

Hi,I can't find the enum in PhoneCamera.Start method。Besides,i wanna test in PC but it does't work and show me “Unable to find back camera” 。

tomret avatar Mar 23 '20 02:03 tomret

@tomret it's not an enum, what I mean is that the camera is picked in the Start method. Change this piece of code:

for(int i = 0; i < devices.Length; i++)
{
     if(!devices[i].isFrontFacing)
     {
           this.backCamera = new WebCamTexture(devices[i].name, Screen.width, Screen.height);
     }
}

Syn-McJ avatar Mar 23 '20 10:03 Syn-McJ