Red5视频聊天教程AS3



我在哪里可以找到基于AS3和Red5的视频聊天应用程序的工作示例?我很难理解如何将用户流附加到另一个用户,反之亦然。有人能指出一个简单的例子或提供一些示例代码吗?

这是一个来自Red5的SimpleChat演示项目的链接:http://www.red5.org/downloads/simpledemos/

无论如何只是给你一个基本的概念:假设您有一个聊天应用程序,那么每个用户都有一个ID,对吗?假设用户 a 开始向用户B:

传输麦克风/摄像头。
//start streaming the mic and camera
nsPub = new NetStream ( netConnection );
nsPub.attachAudio(Microphone.getMicrophone());
nsPub.attachCamera(Camera.getCamera());
nsPub.publish('A');
//need to send a command to user B to notify him that user A started streaming, 
//this command can be sent by a SharedObject or invoking a remote method, that will 
//invoke a client method in B
//code to receive the mic/cam streaming from user A
nsCli = new NetStream ( netConnection );
videoCompoment.attachNetStream( nsCli );
nsCli.play('A');

最新更新