2

我已经下载了 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.CaptureVideoWindowvideoChannel.RenderVideoWindow始终为空(请注意,与此问题不同,videoChannel变量不为空)。

你应该知道的一些事情:

  1. 我在 UI 抑制模式下运行 Lync(通过UISuppressionMode在 HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Lync 位置将注册表项 [DWORD] 添加为 1 来实现)
  2. 示例的音频部分完美运行
  3. 该示例实际上是成功地我的视频流发送到远程方
  4. 对话完成设置后,e.NewState == ChannelState.SendReceive评估为true
  5. 我在 Visual Studio 2012 和 Microsoft Lync 2013 中工作
4

1 回答 1

1

我启动了一个我构建的旧演示(2014 年 1 月的时间框架),一切正常。然后我安装了最新版本的 SDK 并运行了示例,果然,我遇到了同样的问题。

该问题是由于您尝试设置 Microsoft.Lync.Model.Conversation.AudioVideo.VideoWindow 的所有者时出现异常所致。

事实证明,接管此窗口的权限处理方式发生了变化。 现在的“修复”是将应用程序放入运行程序的帐户的用户文件夹中。 我试过了,它确实有效。

这是来自 ConversationWindow.cs:line 1128 的冒犯...

//sets the properties required for the native video window to draw itself
videoWindow.Owner = videoPanel.Handle.ToInt32();

这是错误:

Microsoft.Lync.Model.dll System.UnauthorizedAccessException 中发生了“System.UnauthorizedAccessException”类型的第一次机会异常:访问被拒绝。(来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED))在 Microsoft.Office.Uc.VideoWindowClass.set_Owner(Int32 Owner) 在 Microsoft.Lync.Model.Conversation.AudioVideo.VideoWindow.set_Owner(Int32 value) 在 AudioVideoConversation.ConversationWindow.ShowVideo(Panel c:\Program Files (x86)\Microsoft Office 2013\LyncSDK\samples\AudioVideoConversation\Conversation\ConversationWindow.cs:line 1128 中的 videoPanel、VideoWindow videoWindow)

参考: UISuppression 视频问题

Lync API 工程团队的澄清:通过将示例项目从 \Program Files(x86)... 文件夹复制到一个用户文件夹。编译并运行用户文件夹中的项目,不会出现异常。

于 2014-07-20T20:59:16.440 回答