9 Replies Latest reply on Nov 6, 2011 8:29 AM by mraak

    Flex 4 -> no "attachCamera" with spark VideoDisplay ?

    david128

      Hi all !

      My question is in fact in the title...

      There's no attachCamera method in Spark VideoDisplay...(build 4.0.0.14288)...

      Is it normal ? Is there another way to attach camera with the new VideoDisplay ?

       

      PS: sorry for my english...

        • 1. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
          Gregory Lafrance Level 6

          This page may answer your question:

           

          http://help.adobe.com/en_US/Flex/4.0/langref/flash/media/Video.html

           

          If this post answers your question or helps, please mark it as such.


          Greg Lafrance - Flex 2 and 3 ACE certified

          www.ChikaraDev.com

          Flex / AIR Development, Training, and Support Services

          1 person found this helpful
          • 2. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
            Peter deHaan Level 4

            As far as I understand, the Spark Video* controls are based on the new OSMF framework, which does not currently support attachCamera().

             

            For [slightly] more information, see http://bugs.adobe.com/jira/browse/SDK-25100.

            For more information on OSMF (Open Source Media Framework), see http://opensource.adobe.com/wiki/display/osmf/Open+Source+Media+Framework (I believe that page has links to their user group, forums, bug base, and somewhere to request features)...

             

            Peter

            1 person found this helpful
            • 3. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
              david128 Level 1

              Thx for all !!!

              Good and fast replies

               

              I love flex community

              • 4. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
                Herre_84

                The link to that page seems not to work anymore. I also want to attach a webcam to a Spark VideoDisplay.

                • 5. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
                  david128 Level 1

                  You cannot attach a camera to Spark VideoDisplay.

                  You must use mx VideoDisplay.

                  • 6. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
                    kielsoft

                    In reference to this page: http://stackoverflow.com/questions/4178292/how-do-i-attach-camera-to-spark-components-vide odisplay

                     

                    this is my code

                     

                    <?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="400" minHeight="300" width="500" height="400" >
                         <fx:Declarations>
                              <!-- Place non-visual elements (e.g., services, value objects) here -->
                         </fx:Declarations>
                         <fx:Script>
                              <![CDATA[
                                   import mx.controls.Alert;
                                   import mx.events.FlexEvent;
                                   
                                   import org.osmf.net.StreamType;
                                   
                                   import spark.components.mediaClasses.DynamicStreamingVideoItem;
                                   import spark.components.mediaClasses.DynamicStreamingVideoSource;
                                   
                                   private var _cam:DynamicStreamingVideoSource =  new DynamicStreamingVideoSource();
                                   private var _dynVideoSource:DynamicStreamingVideoSource;
                                   
                                   protected function video_creationCompleteHandler(event:FlexEvent):void
                                   {
                                        _dynVideoSource=new DynamicStreamingVideoSource();
                                        
                                        var videoItems:Vector.<DynamicStreamingVideoItem>;
                                        videoItems=new Vector.<DynamicStreamingVideoItem>();
                                        videoItems[0]=new DynamicStreamingVideoItem();
                                        
                                        _dynVideoSource.host= "";
                                        _dynVideoSource.streamType=StreamType.LIVE;
                                        _dynVideoSource.streamItems=videoItems;
                                        
                                        myVideo.source=_dynVideoSource;
                                        
                                        if(myVideo.videoObject){
                                             Alert.show("Got Video Object: " + myVideo.videoObject, "Notification");
                                        }
                                        else {
                                             Alert.show("Unable To Get Video Object" + myVideo.videoObject, "Notification");
                                        }
                                        
                                        var cam:Camera = Camera.getCamera(); //Camera.names[0]);
                                        cam.setMode(640, 480, 15);
                                        cam.setQuality(0, 80);
                                        myVideo.videoObject.attachCamera(cam); 
                                   }
                              ]]>
                         </fx:Script>
                         <s:Panel x="53" y="26" width="394" height="290" title="My Camera">
                              <s:VideoDisplay id="myVideo"
                                                  x="10" y="10" 
                                                  width="371" height="238" 
                                                  creationComplete="video_creationCompleteHandler(event);"/>
                         </s:Panel>
                    </s:Application>
                    

                     

                    but this is not still working, can someone teill me what I am doing wrong?

                     

                    Thanks.

                    • 7. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
                      andres-l-c Level 1

                      Hi kielsoft.

                      This answer, may be a little late, but I've read your post just today.

                      I think your problem is here:

                      _________________________________________________________

                      var cam:Camera = Camera.getCamera(); //Camera.names[0]);

                      cam.setMode(640, 480, 15);

                      cam.setQuality(0, 80);

                      myVideo.videoObject.attachCamera(cam);

                      _________________________________________________________

                       

                      Please, try this:

                      _________________________________________________________

                      var cam:Camera = Camera.getCamera(); //Camera.names[0]);

                      cam.setMode(640, 480, 15);

                      cam.setQuality(0, 80);

                      //myVideo.videoObject.attachCamera(cam);

                      var localCam:Video = new Video(640,480);

                      localCam.attachCamera(cam);

                      myVideo.addChild(localCam);

                      _________________________________________________________

                       

                      I hope I've been helpful.

                      Regards.

                      • 8. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
                        kielsoft Level 1

                        Thanks so much, I got your response in the other post, Thanks.

                        • 9. Re: Flex 4 -> no "attachCamera" with spark VideoDisplay ?
                          mraak Level 1

                          Flex architecture team is amazingly idiotic, what they did with video displaying objects. Sorry, it had to be said.