Mar 9, 2009
Trick: Auto-select mac iSight in flash.
If you’ve been messing around with Augmented Reality (or any webcam stuff in flash for that matter), you may have come to the realization that many mac users may not have their proper webcams (i.e. iSights) set by default. In a commercial setting, you want to avoid a person having to select their webcam at almost all costs — it’s another barrier to entry, and can be confusing, too. Especially if you have video editing software installed, there can be a lot of options, as you can see below.

However, it’s easy to check and see if the person has an iSight installed and, if so, automatically choose that one.
var index : int = 0;
for ( var i : int = 0 ; i < Camera.names.length ; i++ ) {
if ( Camera.names[ i ] == "USB Video Class Video" ) {
index = i;
}
}
//Oddly, Camera.getCamera needs a string of the camera index, NOT the name of the camera.
_webcam = Camera.getCamera( String( index ) );
VoilĂ . You’re now covered for mac users and windows users won’t notice a thing.

Hi,
At Kaltura we wanted the same, and when we got to write the ContributionWizard (A simple wizard to contribute content from different sources, amongst Cameta, File Upload, websites, etc.) we tried to find a way to automatically search for the most active Camera and Microphone devices.
Two of the problem that rise:
1. Flash recognize everything, including ghost devices and in active application drivers – not just real cameras.
2. Iterating the devices may cause FireFox on Mac to crash.
So we solved this eventually by iterating the devices and checking the image captured on bitmapData, and for Microphone we check the activity. And to solve the crashing problem there is a timeout between detection.
This works, but takes too long depending on the # of devices you got.
you can find the source for the detection class here (under com\kaltura\devicedetection):
http://groups.adobe.com/files/e039de58cc/krecord.rar
Awesome! Thanks for sharing!
Thank you for posting this. I was hitting a frustration limit, running examples from books just purchased, adobe.com, etc. Finally! The camera is showing up!
This is a great solution — thank you.