Matthieu Durindel
Matthieu Durindel

Reputation: 11

Flash Media - refresh camera list on the fly

I try to make an auto refresh of a cameras list with Flash and the Openlazslo framework but I'm not able to detect when a new camera has been plugged or unplugged.

It's a known problem that Flash can't actualize webcams devices on the fly just on recall Camera.names but there is a public function which can force it with scanHardware().

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/package.html#scanHardware%28%29

However, even if I fire this function, Camera.name doesn't update at all.

I can't post entire code because it's part of the big openmeetings project but it's similar to:

<!-- Method call when the panel settings is clicked -->
<method name="initItemsAndDefaultAttachCamera">
<![CDATA[
    //Force to rescan devices
    scanHardware();

    //Get cameras name ... but is never updated after the first load
    var cameras = Camera.names;

    //fill list of Cameras
    // ...
]]>
</method>

It's pretty annoying because users must reload the page to get all of their devices if they plug or unplug it, and in many context they're forced to do it.

I use Chromium with Adobe Flash Player, PPAPI.

Upvotes: 1

Views: 127

Answers (0)

Related Questions