没有文件名的 Flash RTMP 流 - 如何连接?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要首先在服务器上创建直播。
创建流后,您可以通过调用以下命令来播放它:
(nc 是您的 NetConnection 对象)
希望这会有所帮助。
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)
Hope this helped.
使用根目录,即仅使用裸网址并使用shoutcast 作为流标识符
然后,这有一些技巧。
您需要首先创建网络连接...
...然后等待
在 NetConnection 连接成功之前,您无法设置 NetStream,
然后您可以创建 NetStream
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...
...then WAIT
You can't setup a NetStream until the NetConnection connect succeeds
on success you can then create a netstream