Why can't my webgl app find any camera on iphone
It is a WebGL app, tested on 2019.3 - 2020.3
I'm 100% sure SSL/SSH is enabled
PC, Android are working fine.
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);
}
}
Comment
Your answer
Follow this Question
Related Questions
Webgl On Ios 15.4 1 Answer
WebCamTexture nullpointerexception 1 Answer
Unity WebGL Disable mobile warning 12 Answers
WebCam Texture Rotation 0 Answers
App for android/IOS accesible via URL 0 Answers