开发者

Flash RTMP streaming with no filename - How to connect?

开发者 https://www.devze.com 2022-12-22 15:11 出处:网络
Hello good people of SO.I am building a flash media player for an live audio stream.The server is set up to stream from a url that looks lik开发者_开发百科e so:

Hello good people of SO. I am building a flash media player for an live audio stream. The server is set up to stream from a url that looks lik开发者_开发百科e so:

rtmp://ourwowzaserver.net:80/ourfiledirectory

the instructions i have found say to first set the directory:

nc.connect("rtmp://ourwowzaserver.net:80/ourfiledirectory");

and then later play it:

nc.play(mp3:thefilename)

this works when we have discrete filenames on the server (thefilename), but the live stream is not a file - rtmp://ourwowzaserver.net:80/shoutcast. How in the heck do I get .play to play it?

Thanks in advance!


You will need to create a live stream on your server first.

When you have created the stream, you can play it by calling:

(nc is your NetConnection object)

NetStream liveStream = new NetStream(nc);
liveStream.play("streamName");

Hope this helped.


Use the root directory ie just the bare url and use shoutcast for the stream identifier

Then there's a bit of a trick to this.

You need to first create a net connection...

var myNC:NetConnection = new NetConnection();
myNC.connect("rtmp://ourwowzaserver.net:80");

...then WAIT You can't setup a NetStream until the NetConnection connect succeeds

on success you can then create a netstream

var myNS:NetStream = new NetStream(myNC);
myNS.play("shoutcast");
0

精彩评论

暂无评论...
验证码 换一张
取 消