2 Replies Latest reply on Dec 8, 2009 11:54 AM by lyla_tay

    camera.names not correct on mac

    FrankAtcomm
      Hello,

      I developed an AIR app that should use an external camera. Everything works all well on my development PC, but on the Mac's that are used for the project, the built in isight-camera, causes me a lot of troubles. The external Logitech Vision Pro is not shown. Only one camera is available with Camera.names.

      So the built in camera is the only one that seems to be available in AIR. I wrote some code which can be used in an AIR app and a web app to test the list with available cameras and connect to one of them.

      <mx:Script>
      <![CDATA[
      private function connectCamera():void {
      var cam:Camera = Camera.getCamera(cbCameras.selectedIndex.toString());
      videodisplayer.attachCamera(cam);
      }
      ]]>
      </mx:Script>

      <mx:ComboBox id="cbCameras" x="10" y="10" dataProvider="{Camera.names}" width="260" change="connectCamera();" />
      <mx:Button x="275" y="10" label="Start" click="connectCamera();"/>

      <mx:TextArea x="10" y="40" text="Camera names: {Camera.names.toString()}" width="320"/>

      <mx:TextInput x="10" y="92" text="Number of cameras: {Camera.names.length.toString()}" width="320"/>

      <mx:VideoDisplay id="videodisplayer" x="10" y="122" width="320" height="240"/>

      To make it even more frustrating you should try the following with Flex:
      * use this code in an AIR app and run it
      * select "USB Video Class Video", which will show up the built in camera
      * leave this screen open
      * use this code in a web app and run it too
      * this will show up two extra cameras: "DV Video" and "IIDC FireWire Video"
      * select the same USB camera, and in my case this showed the external connected camera !

      Any ideas what's going wrong ?

      Tried this with different apple computers, different versions of OS X.

      Problem could be solved if the internal webcam would be disabled, but this doesn't seem to be possible.

      Thanks a lot,
      Frank
        • 2. Re: camera.names not correct on mac
          lyla_tay

          You're right, there seems to be no way to disable the built-in iSight cam on the MacBook/MacBook Pro - BIG mistake on Apple's part!  Here's a link to a discussion about this from the Apple forum:

          http://discussions.apple.com/thread.jspa?threadID=1374761

           

          This quote, from the page linked above, MIGHT be helpful to you:

          -----

          My Logictech 9000 doesn't show up in the Flash video source dropdown for me either. Selecting USB camera just selects the iSight.

          However, I did find a workaround: it seems to choose the first available usb webcam, which is typically the built-in iSight. If you have a mac mini with no built-in iSight, it uses the external camera by default. For my MacBook, I found the trick was to make the iSight busy by opening Photo Booth first, then opening the flash chat page.  That causes the flash player to find and use the external USB webcam. 

          Note: your webcam probably has to support the new standard USB Video plug-and-play protocol for this to work, and perhaps only on Leopard.

          -----

           

          Of course, have fun trying to explain this to other users of your program... but maybe there is somehow a way that you could code for this, by adding some script that runs the iSight just for the sake of distracting it, before the script runs that is supposed to detect and launch a USB cam as part of your program.  Good luck!