示例#1
0
        void UserVideo_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                if (capture == null & flg == false)
                {
                    if (MyVidType == "Me")
                    {
                        filters = new Filters();

                        cnvUserVideo.Visibility = Visibility.Visible;
                        m_DelSendImage          = new DelSendImage(SetMyImage);

                        try
                        {
                            if (filters.VideoInputDevices.Count > 1)
                            {
                                lstVideoInput = new List <string>();
                                lstVideoInput = filters.VideoInputDevices.GetVideoInputDevices();

                                objShowVideo = new ShowVideoInputs(lstVideoInput);
                                objShowVideo.EntSelectedDevice += new ShowVideoInputs.delSelectedDevice(objShowVideo_EntSelectedDevice);
                                objShowVideo.Show();
                            }
                            else if (filters.VideoInputDevices.Count == 0)
                            {
                            }
                            else
                            {
                                InitCapture("Low", 0);
                            }
                        }
                        catch (Exception ex)
                        {
                            VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "UserVideo_Loaded", "ctlUserVideo.xaml.cs");
                        }
                    }
                    else
                    {
                        picUserVideo.Visibility = Visibility.Visible;

                        m_DelSendImage = new DelSendImage(SetOtherImage);
                    }
                }
                else if (flg)
                {
                    double[] winXY = new double[2];
                    winXY = capture.PreviewWidowTag();

                    if (winXY[0] != 0 & winXY[1] != 0)
                    {
                        if (MyVidType == "Me")
                        {
                            flg = false;
                            capture.showVideo();
                        }
                    }
                    else
                    {
                        capture.hideVideo();
                        flg = true;
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "UserVideo_Loaded", "ctlUserVideo.xaml.cs");
            }
        }