在哪里可以找到基于AS3和Red5的视频聊天应用程序的工作示例?我很难理解如何将用户流附加到另一个用户,反之亦然。有人可以指向一个简单的示例或提供程序一些示例代码吗?
发布于 2013-05-15 23:48:39
下面是来自Red5:http://www.red5.org/downloads/simpledemos/的一个Red5演示项目的链接
无论如何,给您一个基本概念:假设您有一个聊天应用程序,那么每个用户都有一个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');https://stackoverflow.com/questions/16546204
复制相似问题