从 SWF 连接/流式传输到 Flash Media Server

发布于 2024-10-05 11:36:48 字数 404 浏览 0 评论 0原文

我可以访问 CDN 上的闪存媒体服务器。 我想让人们轻松连接到这个服务器。目前,他们需要额外的软件来连接到FMS。 如果他们可以使用浏览器连接到服务器,那就更好了。

所以我假设我需要创建一个 SWF 文件并从该文件连接到 FMS(使用 Actionscript)。

最终结果看起来像 jquery 网络摄像头插件的演示,只是 SWF 文件将建立与 FMS 的连接并将视频流式传输到 FMS。 http://www.xarg.org/project/jquery-webcam-plugin/

我需要显示接受网络摄像头连接的对话框,然后连接服务器并将视频流式传输到服务器。

I have access to a flash media server on a CDN.
I want to allow people to easily connect to this server. Currenty, they need to an additional software to connect to the FMS.
It would be nicer if they could just connect to the server with their browser.

So I assume I need to create a SWF file and connect from this file to the FMS (with Actionscript).

The end result would look like the demo of the jquery webcam plugin, only that the SWF file would establish a connection to the FMS and stream the video to the FMS.
http://www.xarg.org/project/jquery-webcam-plugin/

I need to show the dialog to accept a webcam connection and then connect with and stream the video to the server.

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

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

发布评论

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

评论(1

暖阳 2024-10-12 11:36:48

请参阅FMS 开发指南的第 4 章。

概括地说,您需要执行以下操作:

  • 创建到 FMS 的 NetConnection
  • 使用该连接创建 NetStream
    连接
  • 将摄像头和麦克风连接到
    流(这将自动
    触发网络摄像头对话框)
  • 发布您的流

您将需要添加各种侦听器来接收事件,例如在创建 NetStream 之前检查您是否已成功连接到 FMS,然后开始录制等。

示例代码:

var nc: NetConnection = 新的 NetConnection();
nc.connect("rtmp://myServerName/nameOfFMSapplication/");

var ns:NetStream = new NetStream(nc);

相机 = Camera.getCamera();
麦克风=麦克风.getMicrophone();

ns.attachAudio(相机);
ns.attachAudio(麦克风);

ns.publish("该视频的名称是", "记录");

注意停止发布流:ns.publish(false);

关键的事情之一是与听众一起管理每个阶段,以便在继续下一步之前确保您已连接等。祝你好运!

Take a look at Chapter 4 of the FMS Dev guide.

In outline you need to do the following:

  • create a NetConnection to the FMS
  • create a NetStream using that
    connection
  • attach the camera and microphone to
    the stream (this will automatically
    trigger the webcam dialog)
  • publish your stream

You will need to add various listeners to pick up on the events such as checking that you have successfully connected to the FMS before creating the NetStream and then starting the recording, etc.

Sample code:

var nc:NetConnection = new NetConnection();
nc.connect("rtmp://myServerName/nameOfFMSapplication/");

var ns:NetStream = new NetStream(nc);

camera = Camera.getCamera();
mic = Microphone.getMicrophone();

ns.attachAudio(camera);
ns.attachAudio(mic);

ns.publish("theName ofThisVideoIs", "record");

NB to stop publishing the stream : ns.publish(false);

One of the key things is managing each stage with listeners so that you are sure you are connected etc before you proceed onto the next step. Good Luck!

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