Hi there! I got a problem connecting my USB Camera to my tablet(ASUS K10A)
The device reads only the front and back camera
I’m searching for answers but still no luck, I need help. Thanks in advance!
I put this line in my AndroidManifest to use an external camera device if one is connected.
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera.external" android:required="true"/>
My working code:
#pragma strict
private var devices : WebCamDevice[];
public var deviceName : String;
private var wct : WebCamTexture;
private var resultString : String;
function Start() {
yield Application.RequestUserAuthorization (UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam)) {
devices = WebCamTexture.devices;
deviceName = devices[0].name;
wct = new WebCamTexture(deviceName, 640, 480, 30);
renderer.material.mainTexture = wct;
wct.Play();
resultString = "no problems";
} else {
resultString = "no permission!";
}
}
function OnGUI() {
for (var i = 0; i < devices.length; i++) {
GUI.Box(Rect(100, 100+(i*25), 300, 25),devices*.name);*
}
GUI.Box(Rect(100, 100+(i*25), 400, 25),resultString);
}