【发布时间】:2013-05-07 15:25:42
【问题描述】:
我已下载适用于 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 始终为空(请注意,与this question 不同,videoChannel 变量不为空)。
你应该知道的一些事情:
- 我在 UI 抑制模式下运行 Lync(通过在 HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Lync 位置将注册表项
UISuppressionMode[DWORD] 添加为 1 来实现) - 示例的音频部分完美运行
- 示例实际上是将我的视频流发送成功到远程方
- 完成对话设置后,
e.NewState == ChannelState.SendReceive的计算结果为true - 我正在使用 Visual Studio 2012 和 Microsoft Lync 2013
【问题讨论】:
-
你有没有想过这个问题?
-
还没有。同时提出该项目。 =(
标签: c# sdk video-streaming lync