Skip to main content
Inspiring
Oct 19, 2011 12:39 AM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Participating Frequently
    Oct 19, 2011 8:54 AM UTC

    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

    Translate