3 Replies Latest reply on Oct 19, 2011 10:51 AM by Claudiu Ursica

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

    peixd_fms

      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.