从 SWF 连接/流式传输到 Flash Media Server
我可以访问 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅FMS 开发指南的第 4 章。
概括地说,您需要执行以下操作:
连接
流(这将自动
触发网络摄像头对话框)
您将需要添加各种侦听器来接收事件,例如在创建 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:
connection
the stream (this will automatically
trigger the webcam dialog)
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!