Getting started with Flex 3 and Flash Media Server 3

4 09 2008

This is a just a brief get up and go starting off with Flash Media Server 3 and Flex 3.

For the purposes of this discussion, I’ll be using Flash Media Development Server 3.

The goal of this post is to have two videos streamed into a Flex app – one a live stream, the other a recorded stream.

What you’ll need:

  1. Flash Media Development Server 3 …. free download
  2. Flash Media Encoder 2.5 … free download
  3. a web cam & a mic

So to start off, you download and install the Flash Media Development Server 3 software.

Once installed, jump into the Flash Media Administration Console to have a look around. Guess what – there’s not much to see yet.

Now install the Flash Media Encoder software.

This will take the streams coming in from your webcam and mic and convert them to video. Whilst it’s running – you have a live stream running in “rtmp://localhost/live/livestream” and if you stop it running, it will save a FLV file in the “My Videos” folder of your user.

So do a short 20s video and stop the encoder. You should have a small FLV sitting in “My Videos” called “sample.flv”. This you can copy to your video-on-demand’s media folder which is under “applications/vod/media”.

Now, start the encoder again but leave it on to generate a live stream.

In Flex, write a small app that has two VideoDisplay controls – one for your live stream and one for the video on demand.

<mx:VideoDisplay source=”rtmp://localhost/live/livestream” live=”true” autoPlay=”true” />

<mx:VideoDisplay source=”rtmp://localhost/vod/sample.flv” autoPlay=”true” />

When you run the app, you’ll see your stream and your video, running side by side.