【问题标题】:Red5 video chat tutorial AS3Red5视频聊天教程AS3
【发布时间】:2013-05-14 14:42:45
【问题描述】:

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

【问题讨论】:

标签: streaming video-streaming red5 video-conferencing


【解决方案1】:

这里是 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');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-22
    相关资源
    最近更新 更多