Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>I recognize this is an old question that has been answered, but seeing as this link is the strongest referrer to my post i felt it necessary to make a more informed answer, as well as explain new updates to the CameraDetection library.</em> <br/><br/></p> <blockquote> <h1>causes:</h1> </blockquote> <p>there are a few well known reasons that might cause Camera.getCamera() to return a valid Camera object, but the Camera won't actually work.</p> <ol> <li><p>if the camera is already in use. This is most common if you have skype running on your computer. you don't even have to be using the camera at that moment, but the last i checked, if skype is open, it is stealing your camera.</p></li> <li><p>mac laptops have/used to have multiple cameras listed even though they were not connected. this frequently showed up as DVI camera and something else (sorry for the poor memory). if for some reason one of these 'disconnected' cameras was chosen as the default, then you will experience your problem.</p></li> <li><p>the google chat/video adapter have caused problems in the past. simply having installed it caused many issues for people for a while (this may have started ~2011?) since you never know which OS or player version you'll get this may still be an issue <br/><br/></p></li> </ol> <blockquote> <h1>why this problem sucks:</h1> </blockquote> <p>determining if a Camera is <em>actually</em> working is a pain. the best option we have is to monitor the Camera's activity and fps to see if it is working. <br/><br/></p> <h3>what you should expect</h3> <p>to determine the behavior of a working camera, i use a timer to check on the fps and activity levels of the Camera. this is a common result: (this timer is set at 100ms)</p> <pre><code>fps:0 activity:-1 ... x20 ... fps:0 activity:100 fps:0 activity:100 fps:8.1 activity:5 fps:8.5 activity:46 fps:8.2 activity:3 fps:8.4 activity:3 </code></pre> <p>so, the camera appears unresponsive for <strong>2.1</strong> whole seconds!!! what!?!?!? I know. but then it finally kicks in. this is common behavior even though I am testing this on a 6core 3.3GHz machine with little running. my library keeps checking the camera waiting for these activity and fps levels to change. <br/><br/></p> <h3>what you get when it doesn't work</h3> <p>can you guess what happens when the camera doesn't work? you guessed it!</p> <p>you get this non-stop, forever</p> <pre><code>fps:0 activity:-1 fps:0 activity:-1 fps:0 activity:-1 </code></pre> <p>so my code will check a camera by default for 3 whole seconds, waiting for some activity, and then quit. this is the bad part, maybe all the hardware sucks and the cpu is already overloaded and this makes it take longer than 3 seconds to get a response? woe is us actionscript guys. <br/><br/></p> <blockquote> <h1>CameraDetection</h1> </blockquote> <p>my library does all this and more! it even handles getting permission from the user to use the media devices!</p> <p><strong>updated 2012.10.06</strong>, it now has:</p> <ul> <li><strong>MediaPermissions</strong> - a class that handles the worst part of Cameras. it will get permission, tell you if it was allowed or denied and even tell you if the user had the 'remembered' checkbox selected</li> <li><strong>CameraChecker</strong> - an abstraction to clean up the library.</li> <li><strong>CameraDetection</strong> - simpler to use and tells you even more! get events when the permission dialog opens and closes, when the user gives permission, and when a camera is found, no cameras to use, and even when there are cameras but none of them worked</li> <li><strong>logging!</strong> - almost done, i will be supporting logging of all the data that CameraDetection uses, so maybe we can get enough data to push Adobe into fixing something...</li> </ul> <p>please visit <a href="http://blog.cataclysmicrewind.com/webcamdetection/">CameraDetection homepage</a> and don't forget to view the other posts about it!</p> <p>to get the code you can go directly to <a href="https://github.com/cataclysmicrewind/CameraDetection">github</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload