WebCamDevice.isFrontFacing always returns false on webgl. Mobile or not. If you build the attached package for Android, you will get isFrontFacing == true when the device camera is front, false if not. If you build it for webgl, it will return false for both cameras. This property is frequently used, on every webcam texture tutorial they make use of it to select a camera, so that’s why I’m reporting about this one. There may be other properties that are not having their values set as well, however.
The problem seem to happen because there is no javascript binding to get this property, so it defaults to false.
For example, when you access the WebCamDevice.name property, the javascript _JS_WebCamVideo_GetDeviceName function is called. I didn’t find any corresponding function to the isFrontFacing property.
One way to get this information is to use the MediaStreamTrack.getSettings() method(don’t use the getConstraints method, it only works on Chrome, while getSettings work on both). It returns a bunch of properties, one of them is facingMode.
The catch, though, is that to get this property you need to get the tracks first. And the way it is currently done, you get the devices first. So you’d need to call getUserMedia, get the facing modes, and only then call enumerateDevices. This change will need to be done anyway because Safari only gives you information using enumerateDevices after the user granted camera access using getUserMedia. See my other bug report .
This could raise the issue that the game starts without the user granting permission, and then in Unity no devices are detected because the bindings didn’t run in time. The way it could be done is that the game only starts after the user grants camera permission, so that the device information can be filled in.