1. It is a WebGL app, tested on 2019.3 - 2020.3
2. I'm 100% sure SSL/SSH is enabled
3. PC, Android are working fine.
4. on IOS Debug log is "webcam found, count: 0"
Code:
public MeshRenderer[] renders;
private WebCamTexture[] cams;
IEnumerator Start()
{
findWebCams();
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam))
{
Debug.LogError("webcam found, count: " + WebCamTexture.devices.Length);
cams = new WebCamTexture[WebCamTexture.devices.Length];
for (int i = 0; i < cams.Length; ++i)
{
cams[i] = new WebCamTexture();
cams[i].Play();
renders[i].material.mainTexture = cams[i];
}
}
else
{
Debug.LogError("webcam not found");
}
}
void findWebCams()
{
foreach (var device in WebCamTexture.devices)
{
Debug.Log("Name: " + device.name);
}
}
↧