WEB开发网
开发学院WEB开发ASP.NET OMCS Demo -- 视频、音频、电子白板、远程桌面 ... 阅读

OMCS Demo -- 视频、音频、电子白板、远程桌面 功能基本展现(附源码)

 2012-05-18 17:15:30 来源:WEB开发网   
核心提示:} if (microphone) { this.microphoneConnector1.BeginConnect(this.friendID); } } void cameraConnector1_ConnectEnded(ConnectResult result) { if (this.Invok
}

if (microphone)
{
this.microphoneConnector1.BeginConnect(this.friendID);
}
}

void cameraConnector1_ConnectEnded(ConnectResult result)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new CbGeneric<ConnectResult>(this.cameraConnector1_ConnectEnded), result);
}
else
{
//显示视频连接结果
this.label_camera.Text = string.Format("视频:{0}", result == ConnectResult.Succeed ? "正常" : result.ToString());
}
}

void microphoneConnector1_ConnectEnded(ConnectResult result)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new CbGeneric<ConnectResult>(this.microphoneConnector1_ConnectEnded), result);
}
else
{
//显示音频连接结果
this.label_microphone.Text = string.Format("音频:{0}", result == ConnectResult.Succeed ? "正常" : result.ToString());
}
}

void cameraConnector1_Disconnected(ConnectorDisconnectedType connectorDisconnectedType)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new CbGeneric<ConnectorDisconnectedType>(this.cameraConnector1_Disconnected), connectorDisconnectedType);
}
else
{
this.label_camera.Text = string.Format("视频:断开,{0}", connectorDisconnectedType);
}
}

void microphoneConnector1_Disconnected(ConnectorDisconnectedType connectorDisconnectedType)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new CbGeneric<ConnectorDisconnectedType>(this.microphoneConnector1_Disconnected), connectorDisconnectedType);
}
else
{
this.label_microphone.Text = string.Format("音频:断开,{0}", connectorDisconnectedType);
}
}
最后,在直接关闭ChatForm的时候,需要主动断开连接器并释放连接器对象。
private void ChatForm_FormClosing(object sender, FormClosingEventArgs e)
{
this.cameraConnector1.Disconnect();
this.cameraConnector1.Dispose();

this.microphoneConnector1.Disconnect();
this.microphoneConnector1.Dispose();
}
电子白板和远程桌面也是类似的流程,这里就不赘述了。关于更多OMCS客户端的开发细节的描述可以参见OMCS开发手册(01) -- 多媒体设备管理器和OMCS开发手册(02) -- 多媒体连接器。
三.下载
Demo源码:OMCS.Demos.Simplest.rar
运行Demo进行测试时,请注意:
(1)将服务端部署到一台服务器上,然后启动OMCS.Server.exe。
(2)修改客户端配置文件中的服务器的IP,在一台机器上启动客户端,登录一个帐号,比如aa01。
(3)在另一台机器上启动客户端,登录另一个帐号,比如aa02。
(4)aa01可以在主界面的TextBox中中输入aa02,并点击后面的按钮,来连接aa02的视频。
(5)aa02也可以在其UI中输入aa01,并点击后面的按钮,来连接aa01的视频。这样可以演示视频聊天的功能了。
(6)测试视讯时,两个客户端最好在不同的房间,以防止声音相互干扰。
(7)测试白板时,需要连接到同一个用户的白板,才能协同。 

上一页  1 2 3 

Tags:OMCS Demo 视频

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接