views:

844

answers:

2

I'm working on a flash app that allows users to take snapshots of themselves using their webcam. It seems that on certain computers (mostly macbooks and MBPs so far) the flash player 10 default webcam setting is for "DV video" rather than "USB Video Class Video", which is the required setting (as far as I know) to allow flash to tap into the webcam stream. If a user's flash settings aren't configured appropriately, they simply get a black box where their video preview should be, rather than the live video stream.

Are there any workarounds for this? I would rather avoid resorting to a "having trouble?" popup with instructions for changing Flash webcam settings if at all possible.

A: 

It seems you can add a parameter to the getCamera static method of the Camera class in order to use a specific cam.

If the iSight is your third camera in the list of the Flash Player configuration panel, you can try this :

if (System.capabilities.os.indexOf("Mac")>-1)
    camera = Camera.getCamera("2");

You can also read this article, which may interest you.

Zed-K
A: 

Flash CS5 throws an error using System.capabilities.os but:

import flash.system.Capabilities;

then:

Capabilities.os

Works great.

Tama