Fix: iSight camera does not work in Flash

Posted on August 11, 2009

2


I stumbled upon an issue regarding Flash and the iSight camera.

Flash and camera’s

All available camera’s are presented in an indexed list within Flash. The first in the list will be used by default by the Camera-object. In my case, the current “video” objects are: “DV Video”, “IIDC FireWire Video” and “USB Video Class Video” so Flash will try to use “DV Video” for camera input. Which does not work.

This is the short hand solution for the Mac (improvements to be made, to make it work cross platform):

for(var i:int = 0; i<Camera.names.length; i++)
{
   trace(String(Camera.getCamera(String(i)).name));
   // For some reason, getCamera requires the input number as a String value
   switch(Camera.getCamera(String(i)).name)
   {
      case "USB Video Class Video":
      camera=Camera.getCamera(String(i))
      trace("USB video")
      break;
    }
 }

Original source:

http://forums.macrumors.com/archive/index.php/t-281447.html

Advertisements
Posted in: Workarounds