Custom Search

Streaming MP3 using Adobe Flash Media Server

Unlike progressive playing mp3 file from internet streaming mp3 is somewhat different. This article will discuss on streaming Mp3 files using Flash Media Server.

NOTE:

Folder Structure for Storing MP3 Files:
For an application to stream MP3 files all the mp3 files should reside inside “applicationname/streams/_definst_/” folder.

Action Script Code:

//create a netConnection object
var nc = new NetConnection();
 
nc.onStatus = function(info)
{
	if(info.code == "NetConnection.Connect.Success")
	{
		streamMP3Files();
	}
}
 
//this function is called once we have connected up to the server
function streamMP3Files()
{
	//this is the netStream object that plays the video file
	ns = new NetStream(nc);
 
	//attach the video stream to the video object on the stage
	vidObject.attachAudio(ns);
 
	//play the video file that we put in the directory for the application
	var filename = "mp3:filename"; //filename is the name of mp3 file without .mp3 extension
 
	ns.play(filename);
}
 
nc.connect("rtmp://localhost/audiotest/");





Explanation:

Folder Structure
Streaming MP3 using Adobe Flash Media Server

Custom Search

Related Post

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

Hi,

this example very help full for me.

Thank you very much
Regards,
Deepak Tomar

Leave a comment

(required)

(required)