The docs say
If getCamera() returns null, either the camera is in use by another application, or there are no cameras installed on the system. To determine whether any cameras are installed, use the names.length property
So to detect that the camera is taken, I should be able to check if (Camera.getCamera() == null && Camera.names.length > 0)
, right?
I can duplicate having my webcam "taken" by another application by opening Webcam Toy in IE, and then trying to debug my application in Chrome, but Camera.getCamera()
still returns a camera object, even when I can't see the feed from my webcam.
If I turn off the IE application and restart my app in Chrome, I can see the feed again.
Is the documentation wrong, or am I wrong?
Hopefully this will help. I wrote a blog post a while back about detecting multiple cameras and setting the default in AS3. Hopefully you find this information useful.
Blog post: http://www.charlesclements.net/blog/flash-as3-setting-default-camera-part-2/
Source files: http://www.charlesclements.net/blog/swfs/camera_detection/UseDefaultCameras_201203141746.zip