Thank you very much Abdul,
After a good battle I was arrived to your second proposition, very light and simple. 
I wanted to go the 'deluxe' way and bundle it into a .swc so I could instantiate a <video> tag and pass arguments like 'height', 'width', 'src' video settings etc ... but coudn't get it work :(( I can load it into a container but can't access the video object inside (I simplified, just trying to attachVideo on the client side without Flashcom) :((
I am actualy digging the flex doc 'Developing Flex Components and Themes in Flash AUthoring' to see what I miss.
Whenever I get something solid like a rock, I'll post the file ;))
 
Cheers,
 
Philippe Maegerman


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Abdul Qabiz
Sent: jeudi 7 juillet 2005 14:57
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Camera

Hi,

You don't need a VideoObject to send stream to flashcom. But you need it
to see what is going to server :)

Video class can not be instantiated using ActionScript. You need to have
a Video Symbol in your swf.

There are two methods:

1) Use MediaDisplay
2) Create a swf with Video symbol and embed in Flex app.

First method would work without much effort but file size might be more,
because entire MediaDisplay code would be in swf even though you won't
be using any MediaDisplay functionality.

Second method would take 5-10 minutes more effort for creating a swf
with Video symbol using Macromedia Flash IDE. But final output of your
application would be small.

I am going to show you both ways here. See the following code and also
at attached files:


1) ##CameraUsingMediaDisplay.mxml##

<?xml version="1.0" encoding="iso-8859-1"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
width="600" height="600" creationComplete="onAppInit()" >
   
    <mx:Script>
        <![CDATA[
           
            var video:Video;
            var camera:Camera;
            var netConnection:NetConnection;
            var netStream:NetStream;
           
            function onAppInit()
            {
                //Get there reference of video object, check
MediaDisplay.as in FlexforFlash.zip.
                video = mediaDisplay["_videoHolder"]._video;
          
                //Make a new connection object
                netConnection = new NetConnection();
  
                //Connect to the service
     
//my_nc.connect("rtmp://server.com/yourapp/theInstance");
            }  
           
            function startCamera()
            {
                camera = Camera.get();
                video.attachVideo(camera);
               
                 //netStream = new NetStream(netConnection);
                 //netStream.attachVideo(camera);
                //netStream.publish("myCameraStream", "live");
               
            }
        ]]>
    </mx:Script>
    <mx:MediaDisplay id="mediaDisplay" width="340"
height="280"></mx:MediaDisplay>
    <mx:Button label="Start Camera" click="startCamera()"/>
   
</mx:Application>


2) ##CameraUsingVideoSymbol.mxml##

<?xml version="1.0" encoding="iso-8859-1"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
width="600" height="600" creationComplete="onAppInit()" >
   
    <mx:Script>
        <![CDATA[
           
            //emebd videoHolder.swf which contains a movieclip
symbol 'videoHolder'. videoHolder movieclip is wrapper around Video
object
            [Embed(source="videoHolder.swf", symbol="videoHolder")]
            var videoHolder:String;
           
            var video:Video;
            var camera:Camera;
            var netConnection:NetConnection;
            var netStream:NetStream;
           
                
            function onAppInit()
            {
                //_video is the instance name of Video object inside
videoHolder movieclip.
                video = image.content._video;
          
                //Make a new connection object
                netConnection = new NetConnection();
  
                //Connect to the service
     
//my_nc.connect("rtmp://server.com/yourapp/theInstance");
            }  
           
            function startCamera()
            {
                camera = Camera.get();
                video.attachVideo(camera);
               
                 //netStream = new NetStream(netConnection);
                 //netStream.attachVideo(camera);
                //netStream.publish("myCameraStream", "live");
               
            }
        ]]>
    </mx:Script>
    <mx:Image id="image" contentPath="videoHolder" width="340"
height="280" />
    <mx:Button label="Start Camera" click="startCamera()"/>
   
</mx:Application>




-abdul




________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Philippe Maegerman
Sent: Thursday, July 07, 2005 4:00 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Camera


Is it possible to instantiate a Video Object in Flex to attach a webcam
and stream to flashcom?

Philippe Maegerman



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com



________________________________

YAHOO! GROUPS LINKS


      *      Visit your group "flexcoders
<http://groups.yahoo.com/group/flexcoders> " on the web.
       
*      To unsubscribe from this group, send an email to:
      [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
       
*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .


________________________________


------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**

This e-mail and any attached files are confidential and intended solely
for the use of the individual to whom it is addressed. If you have
received this email in error please send it back to the person that sent
it to you. Any views or opinions presented are solely those of author
and do not necessarily represent those the Emakina Company. Unauthorized
publication, use, dissemination, forwarding, printing or copying of this
email and its associated attachments is strictly prohibited.

We also inform you that we have checked that this message does not
contain any virus but we decline any responsability in case of any
damage caused by an a non detected virus.
------------------------------------------------------------------



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**

This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.
------------------------------------------------------------------

Reply via email to