SDK for Lync 2013 をダウンロードしましたが、 にあるコード サンプルに問題があります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
とは常に null です (この質問とは異なり、変数は null ではないvideoChannel.RenderVideoWindow
ことに注意してください)。 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 で作業しています