我正在建立一个实时流媒体网站,我正在使用 1- FMS 2- Apache 网络服务器
我已经做了订阅者,我工作得很好。但我需要建立发布者以允许用户从他们的相机广播他们的流。
我已经测试了一个使用 actionscript 构建的发布者,直到我在我的本地主机上安装了 fms 之后它才工作,但我需要一个任何用户都可以在他的网络浏览器中使用的发布者。
我的出版商:
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
connection = new NetConnection();
connection.connect("rtmp:/live");
connection.addEventListener(NetStatusEvent.NET_STATUS,onConnected);
}
private function setupVideo():void
{
//setting up outgoing devices
camera = Camera.getCamera();
camera.setMode(640,480,30);
mic = Microphone.getMicrophone();
//setting up outgoing Stream
outStream = new NetStream(connection);
outStream.attachCamera(camera);
outStream.attachAudio(mic);
outStream.publish("EraMaX-Live");
//setting up outgoing video & attach outgoing devices
outVideo = new Video();
outVideo.attachCamera(camera);
//setting up incomming Stream
inStream = new NetStream(connection);
inStream.play("EraMaX-Live");
//setting up incomming video & attach incoming Stream
inVideo = new Video();
inVideo.attachNetStream(inStream);
//wrap video object
outVideoWrapper = new UIComponent();
outVideoWrapper.addChild(outVideo);
addElement(outVideoWrapper);
inVideoWrapper = new UIComponent();
inVideoWrapper.addChild(inVideo);
addElement(inVideoWrapper);
inVideoWrapper.move(400,0);
//setting up incomming video
}
所以我的问题是我必须有 FMS 才能从我的相机发布一个流到我的网站吗?