How to Stream an FLV Movie via RTMP
If you want to stream in Flash, you will have to make an FLV file. FLV is currently proprietary so the only way to render is through Flash MX or Sorenson Spark.
Streaming Macromedia FLV files in flash is pretty easy. After you've got your Flash Communications Server hosting package, you just upload your flv files to your web directory and set up your player movie. Your flash player movie can be hosted anywhere. It calls the movie FLV file onto the stage. Only the FLV file is required on the Windows server. Below is an example of a simple streaming flv file to get your feet wet.
Here's the Flash Action Script you will need to make an FLV file play on the Flash stage. Start by creating a new Flash file and call it myFLV.fla. In the timeline, put the following ActionScript in frame one:
The above code goes in frame 1 of your movie.
Next, you'll want to embed a video stream object into your swf file. This is the box your FLV movie will play inside of.
- Open the library and create a 'New Video' object.
- drag the new Video Object to the stage.
- Name the instance of this video symbol "MyVideo"
- Publish your movie.
- You should have a swf file now called myFLV.swf
This example requires an flv file to play. In our example the FLV is called timescape.
Timescape would rest on the Metasphere server in your user folder at the following location.
If you do not have a streams folder already, Flash will create one for you when you run this example. But since you need to upload the timescape.flv file for the example to work, you can create the folder yourself. The color coding is an attempt to show how the ActionScript
relates to the FTP upload directory. The streams folder is a strict named folder. It must be called "streams".