This post deals with how you would publish and broadcast an Audio and/or Video Stream using FMS (Flash Media Server) and Flex.
You would need to have FMS installed on your system (you can get a free developer edition if you don’t have one) and Flex of course 🙂
To publish a stream, you would require a WebCam and/or Microphone hardware. You would also require the following files
Now lets look at publish.mxml. These are the steps to be followed
- A NetConnection Object has to be used to connect to the FMS Server. This is done in the initConnection() method in the code.
- The client propery of the NetConnection Object is set to a particular class (Indicates the object on which callback methods should be invoked.)
- objectEncoding is set to AMF0 (Action Message Format) since FMS2.0 is built on AS2 which uses AMF0 while Flex is built on AS3 which streams using AMF3 by default.
Once the connection is established using the NetConnection Object, it generates a netStatus Event. You can then tap into this event and check if the connection is established. Once the connection is established you can publish the stream, using the NetStream Object.
Once the stream is published, you can write another application to tap into it…. Here’s an example that lets you do that.