Custom Search

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:

Folder Structure for Storing FLV Files:
Stream FLV Files

As you can see for an application to stream FLV files all the FLV files should reside inside “streams/_definst_/” folder.

Your email:  
Subscribe Unsubscribe  


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:

Your email:  
Subscribe Unsubscribe  

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

(required)

(required)