Skip to main content
Inspiring
October 19, 2011
Question

the problem in using of (mx) VideoDisplay.attachCamera(camera) in flex webapp

  • October 19, 2011
  • 1 reply
  • 487 views

i have encountered a problem last night. my code looks like the following:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955" minHeight="600">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            private function onCreateComplete():void
            {
                var camera:Camera = Camera.getCamera();

                if(camera)
                     vid.attachCamera(camera);
            }
        ]]>
    </fx:Script>
    <mx:VideoDisplay id="vid" width="300" height="300"
                     verticalCenter="0" horizontalCenter="0"
                     creationComplete="onCreateComplete()"/>
</s:Application>

when i run the code above in my firefox, the videodisplay component showed in the browser,

but the video captured by my camera didn't show in the videodisplay.

if i change the <s:application> to <s:windowedapplication>, and run as a desktop app, everything is OK.

then what is the problem of not showing the video captured by my camera in flex webapp?

BTW, my flashbuidler's flex SDK is 4.5.

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    October 19, 2011

    Please post your query on flex forum as it does not look like FMS issue : http://forums.adobe.com/community/flex/flex_general_discussion?view=discussions