2 Replies Latest reply on Nov 14, 2007 4:07 PM by SenkoRasic

    Live Streaming video and Flex2(3?) + Flash Media Server?

    4674389ysdafsdafdfd
      I've seen alot of topic on how to create video sites for clips, etc. with Flex and Flash Media Server, but how about live streaming video, like a concert or a seminar. I can't find any information on this at all, could anyone point me in the right direction?

        • 1. Re: Live Streaming video and Flex2(3?) + Flash Media Server?
          kaloalex
          I'm looking into the same thing. I found this last night. The RTMP stuff seems like a good starting point.

          https://admin.adobe.acrobat.com/_a227210/p78614671
          • 2. Re: Live Streaming video and Flex2(3?) + Flash Media Server?
            SenkoRasic
            What you need is grab video/sound form camera/mic, publish it on FMS and let the other clients play it. In a few steps:

            // get camera and mic
            var cam:Camera = Camera.getCamera(); // get default camera
            var mic:Microphone = Microphone.getMicrophone(); // get default mic

            // if you have VideoDisplay, for monitoring
            videoDisplay.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();
            ns.attachCamera(cam);
            ns.attachMicrophone(mic);
            ns.publish("streamname", "live"); // or "record" if you want to live+rec
            });
            // connect to default instance of app 'appname' on your FMS
            nc.connect("rtmp://fms.ip.address/appname");

            If you're using Flex2 and FMS2 (the latest FMS is 3), you might need to
            cuange the connection encoding to AMF0 (which is what FMS2 uses) in order for this to work.

            Hope this helps; I've written it from my head so it probably has mistakes, but it's the general workflow; the docs in the language reference for specific functions mentioned here will also help.