0 Replies Latest reply on Jul 1, 2010 2:52 AM by xpsdeset

    flex 4 fms 3 conectivity problem

    xpsdeset

      i want to stream and record video via webcam.

      so far from reference i cam up with this

       

      i saw in the administartion panel that my app connect with the application but it neither records nor streams the video.

      the rows active loaed connected is has values 1.

      please helpme i am new to flex and this fms is wrecking my brain.

      a simple example for flex 4 fms 3 would be appreciated.

       

       

      private function initRecordStream():void
                     
                     
                {
                     
                     if (Camera.getCamera())
                     {
                          
                          var cam:Camera = Camera.getCamera(); // get default camera
                          //var mic:Microphone = Microphone.getMicrophone(); // get default mic
                          
                          // if you have VideoDisplay, for monitoring
                          v1.attachCamera(cam);
                          
                          // create new RTMP connection to FMS/your app
                          var nc:NetConnection = new NetConnection();
                          
                          // new stream should be create *after* nc has connected, not before
                          // so this is executed after the below nc.connect() succeeds
                          //nc.attachEventListener(Event.CONNECT, function(){
                               var ns:NetStream = new NetStream(nc);
                               ns.attachCamera(cam);
                               //ns.attachMicrophone(mic);
                               ns.publish("streamname", "record"); // or "record" if you want to live+rec
                          //});
                          // connect to default instance of app 'appname' on your FMS
                          nc.connect("rtmp:/test"); 
                          
                          
                     }     
                     
                     
                     
                }