我已经下载了 Lync 2013 的 SDK,但在AudioVideoConversation.csproj
. 该项目旨在通过 Lync API 演示音频/视频对话的使用。我无法让视频部分在示例应用程序中运行。问题出在这种方法中:
/// <summary>
/// Called when the video state changes.
///
/// Will show Incoming/Outgoing video based on the channel state.
/// </summary>
void videoChannel_StateChanged(object sender, ChannelStateChangedEventArgs e)
{
//posts the execution into the UI thread
this.BeginInvoke(new MethodInvoker(delegate()
{
//updates the status bar with the video channel state
toolStripStatusLabelVideoChannel.Text = e.NewState.ToString();
//*****************************************************************************************
// Video Content
//
// The video content is only available when the Lync client is running in UISuppressionMode.
//
// The video content is not directly accessible as a stream. It's rather available through
// a video window that can de drawn in any panel or window.
//
// The outgoing video is accessible from videoChannel.CaptureVideoWindow
// The window will be available when the video channel state is either Send or SendReceive.
//
// The incoming video is accessible from videoChannel.RenderVideoWindow
// The window will be available when the video channel state is either Receive or SendReceive.
//
//*****************************************************************************************
//if the outgoing video is now active, show the video (which is only available in UI Suppression Mode)
if ((e.NewState == ChannelState.Send
|| e.NewState == ChannelState.SendReceive) && videoChannel.CaptureVideoWindow != null)
{
//presents the video in the panel
ShowVideo(panelOutgoingVideo, videoChannel.CaptureVideoWindow);
}
//if the incoming video is now active, show the video (which is only available in UI Suppression Mode)
if ((e.NewState == ChannelState.Receive
|| e.NewState == ChannelState.SendReceive) && videoChannel.RenderVideoWindow != null)
{
//presents the video in the panel
ShowVideo(panelIncomingVideo, videoChannel.RenderVideoWindow);
}
}));
}
变量videoChannel.CaptureVideoWindow
和videoChannel.RenderVideoWindow
始终为空(请注意,与此问题不同,videoChannel
变量不为空)。
你应该知道的一些事情:
- 我在 UI 抑制模式下运行 Lync(通过
UISuppressionMode
在 HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Lync 位置将注册表项 [DWORD] 添加为 1 来实现) - 示例的音频部分完美运行
- 该示例实际上是成功地将我的视频流发送到远程方
- 对话完成设置后,
e.NewState == ChannelState.SendReceive
评估为true
- 我在 Visual Studio 2012 和 Microsoft Lync 2013 中工作