没有文件名的 Flash RTMP 流 - 如何连接?

发布于 2024-08-24 01:45:55 字数 434 浏览 8 评论 0原文

SO的好人们你们好。我正在构建一个用于实时音频流的闪存媒体播放器。服务器设置为从如下所示的网址进行流式传输:

rtmp://ourwowzaserver.net:80/ourfiledirectory

我找到的说明说首先设置目录:

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

然后稍后播放:

nc.play(mp3:thefilename)

当我们在服务器上有离散的文件名(文件名),但实时流不是文件 - rtmp://ourwowzaserver.net:80/shoutcast。我到底如何让 .play 来玩它?

提前致谢!

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 like 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初与友歌 2024-08-31 01:45:55

您需要首先在服务器上创建直播。

创建流后,您可以通过调用以下命令来播放它:

(nc 是您的 NetConnection 对象)

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

希望这会有所帮助。

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.

瞎闹 2024-08-31 01:45:55

使用根目录,即仅使用裸网址并使用shoutcast 作为流标识符

然后,这有一些技巧。

您需要首先创建网络连接...

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

...然后等待
在 NetConnection 连接成功之前,您无法设置 NetStream,

然后您可以创建 NetStream

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

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");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文