コード例 #1
0
        private void OnDisposed(object sender, EventArgs e)
        {
            try
            {
                switch (_channel.ChannelType)
                {
                case ChannelType.Local:
                {
                    var isOK = LAL.DetachStreamFromWindow(MediaTypeEnum.PLCM_MF_STREAM_LOCAL, _channel.ChannelID, _channel.Call.CallHandle);
                    if (!isOK)
                    {
                        MessageBox.Show("本地视频卸载失败");
                    }
                }
                break;

                case ChannelType.Remote:
                {
                    var isOK = LAL.DetachStreamFromWindow(MediaTypeEnum.PLCM_MF_STREAM_REMOTE, _channel.ChannelID, _channel.Call.CallHandle);
                    if (!isOK)
                    {
                        MessageBox.Show("远程视频卸载失败");
                    }
                }
                break;

                case ChannelType.Content:
                {
                    var isOK = LAL.DetachStreamFromWindow(MediaTypeEnum.PLCM_MF_STREAM_CONTENT, _channel.ChannelID, _channel.Call.CallHandle);
                    if (!isOK)
                    {
                        MessageBox.Show("共享视频卸载失败");
                    }
                }
                break;
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #2
0
        private void RenderVedio()
        {
            try
            {
                var hwnd = pnlVideo.Handle;
                if (_channel.IsVideo)
                {
                    switch (_channel.ChannelType)
                    {
                    case ChannelType.Local:
                    {
                        var isOK = LAL.AttachStreamToWindow(hwnd, _channel.Call.CallHandle, MediaTypeEnum.PLCM_MF_STREAM_LOCAL, _channel.ChannelID, this.pnlVideo.Width, this.pnlVideo.Height - 40);
                        if (!isOK)
                        {
                            MessageBox.Show("本地视频附加失败");
                        }
                    } break;

                    case ChannelType.Remote:
                    {
                        var isOK = LAL.AttachStreamToWindow(hwnd, _channel.Call.CallHandle, MediaTypeEnum.PLCM_MF_STREAM_REMOTE, _channel.ChannelID, this.pnlVideo.Width, this.pnlVideo.Height - 40);
                        if (!isOK)
                        {
                            MessageBox.Show("远程视频附加失败");
                        }
                    }
                    break;

                    case ChannelType.Content:
                    {
                        var isOK = LAL.AttachStreamToWindow(hwnd, _channel.Call.CallHandle, MediaTypeEnum.PLCM_MF_STREAM_CONTENT, _channel.ChannelID, this.pnlVideo.Width, this.pnlVideo.Height - 40);
                        if (!isOK)
                        {
                            MessageBox.Show("共享视频附加失败");
                        }
                    }
                    break;
                    }
                }
                else  //音频
                {
                    switch (_channel.ChannelType)
                    {
                    case ChannelType.Local:
                    {
                        var isOK = LAL.DetachStreamFromWindow(MediaTypeEnum.PLCM_MF_STREAM_LOCAL, _channel.ChannelID, _channel.Call.CallHandle);
                        if (!isOK)
                        {
                            MessageBox.Show("本地视频卸载失败");
                        }
                    }
                    break;

                    case ChannelType.Remote:
                    {
                        var isOK = LAL.DetachStreamFromWindow(MediaTypeEnum.PLCM_MF_STREAM_REMOTE, _channel.ChannelID, _channel.Call.CallHandle);
                        if (!isOK)
                        {
                            MessageBox.Show("远程视频卸载失败");
                        }
                    } break;

                    case ChannelType.Content:
                    {
                        var isOK = LAL.DetachStreamFromWindow(MediaTypeEnum.PLCM_MF_STREAM_CONTENT, _channel.ChannelID, _channel.Call.CallHandle);
                        if (!isOK)
                        {
                            MessageBox.Show("共享视频卸载失败");
                        }
                    }
                    break;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }