Streaming FLV using Adobe Flash Media Server
Unlike progressive playing FLV file from internet streaming FLV is somewhat different. This article will discuss on streaming FLV files using Adobe Flash Media Server.
NOTE:
- The FLV files to be streamed has to reside on the server where Adobe Flash Media Server is installed
Folder Structure for Storing FLV Files:

As you can see for an application to stream FLV files all the FLV files should reside inside “streams/_definst_/” folder.
NOTE:
This code assumes that you have already placed an video object by name videoObject. We can create video object through library in Flash 8 or Flash MX 2004 Professional.
//create a netConnection object var nc = new NetConnection(); nc.onStatus = function(info) { if(info.code == "NetConnection.Connect.Success") { streamFLVFiles(); } } //this function is called once we have connected up to the server function streamFLVFiles() { //this is the netStream object that plays the video file ns = new NetStream(nc); //Attaching Audio and Video to the Video Object created from Library videoObject.attachAudio(ns); videoObject.attachVideo(ns); //filename is the name of the flv file, should reside inside "streams/_definst_/" folder. var filename = "Stream"; //filename is the name of the flv file ns.play(filename); } nc.connect("rtmp://localhost/videotest/");
NOTE:
This code assumes that you have already placed an video object by name videoObject
Code Explanation:
- Creating an new NetConnection() object for connecting to Adobe Flash Media Server
- I am also connecting to Adobe Flash Media Server using nc.connect() statement
- After successfull connection to the videotest application i am calling streamFLVFiles function
Similar Posts
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.


Comments
No comments yet.
Leave a comment