示例#1
0
        public void SetSelectedLocalCamera(LocalCameraModel camera)
        {
            var cameraToSelect = LocalCameras.FirstOrDefault(x => x.Id == camera.Id);

            if (_wfHostSizes.ContainsKey(WF_LOCAL))
            {
                _connector.HideView(_localHandle);
                _connector.AssignViewToLocalCamera(_localHandle, camera.Object, false, false);
                _connector.ShowViewAtPoints(_localHandle, 0, 0, _wfHostSizes[WF_LOCAL].Item1, _wfHostSizes[WF_LOCAL].Item2);
                _localCameraAssigned = true;
            }
            if (cameraToSelect != null)
            {
                LocalCameras.Select(x =>
                {
                    x.IsStreamingVideo = false;
                    return(x);
                })
                .ToList();
                cameraToSelect.IsStreamingVideo = true;

                Log.Info(string.Format("Local camera selected: name={0} id={1}", cameraToSelect.DisplayName,
                                       cameraToSelect.Id));
            }
            _SelectedCamera = camera.Object;
        }
示例#2
0
 public void AddLocalCamera(LocalCameraModel camera)
 {
     if (LocalCameras.FirstOrDefault(x => x.Id == camera.Id) == null)
     {
         System.Windows.Application.Current.Dispatcher.Invoke(() => LocalCameras.Add(camera));
         Log.Info(string.Format("Added local microphone: name={0} id={1}", camera.DisplayName, camera.Id));
     }
 }
示例#3
0
        private void ShareVideoContent()
        {
            var contentToShare = LocalCameras.FirstOrDefault(x => x.IsSharingContent);

            if (contentToShare != null)
            {
                _connector.SelectVideoContentShare(contentToShare.Object);
                Log.InfoFormat("Set selected video content sharing: name={0} id={1}", contentToShare.DisplayName,
                               contentToShare.Id);
            }
        }
示例#4
0
        private void SelectLocalCamera()
        {
            var camToSelect = LocalCameras.FirstOrDefault(x => x.IsStreamingVideo);

            if (camToSelect != null)
            {
                _connector.SelectLocalCamera(camToSelect.Object);
                Log.Info(string.Format("Set selected local camera: name={0} id={1}", camToSelect.DisplayName,
                                       camToSelect.Id));
            }
        }
示例#5
0
        public void RemoveLocalCamera(LocalCameraModel camera)
        {
            var cameraToRemove = LocalCameras.FirstOrDefault(x => x.Id == camera.Id);

            if (cameraToRemove != null)
            {
                System.Windows.Application.Current.Dispatcher.Invoke(() => LocalCameras.Remove(cameraToRemove));
                Log.Info(string.Format("Removed local camera: name={0} id={1}", cameraToRemove.DisplayName,
                                       cameraToRemove.Id));
            }
        }
示例#6
0
        public void SetSelectedVideoContent(LocalCameraModel camera)
        {
            var camToSelect = LocalCameras.FirstOrDefault(x => x.Id == camera.Id);

            if (camToSelect != null)
            {
                LocalCameras.Select(x =>
                {
                    x.IsSharingContent = false;
                    return(x);
                })
                .ToList();
                camToSelect.IsSharingContent = true;

                Log.InfoFormat("Video content share selected: name={0} id={1}", camToSelect.DisplayName, camToSelect.IsSharingContent);
            }
        }
示例#7
0
        public void SetSelectedLocalCamera(LocalCameraModel camera)
        {
            var cameraToSelect = LocalCameras.FirstOrDefault(x => x.Id == camera.Id);

            if (cameraToSelect != null)
            {
                LocalCameras.Select(x =>
                {
                    x.IsStreamingVideo = false;
                    return(x);
                })
                .ToList();
                cameraToSelect.IsStreamingVideo = true;

                Log.Info(string.Format("Local camera selected: name={0} id={1}", cameraToSelect.DisplayName,
                                       cameraToSelect.Id));
            }
        }
示例#8
0
        /// <summary>
        /// Entry point. Prepares and launches Vidyo functionality.
        /// </summary>
        /// <param name="handle">Control's handler where video will be rendered.</param>
        /// <param name="width">Width of video area.</param>
        /// <param name="height">Height of video area.</param>
        public void Init(IntPtr handle1, IntPtr handle2, IntPtr handle3, IntPtr handle4, IntPtr handle5, IntPtr localHandle)
        {
            ConnectorPKG.Initialize();
            DisplayName = "DemoUser";
            Portal      = "https://vidyocloud.com";
            _sortedHandles.Add(1, handle1);
            _sortedHandles.Add(2, handle2);
            _sortedHandles.Add(3, handle3);
            _sortedHandles.Add(4, handle4);
            _sortedHandles.Add(5, handle5);
            Log.Info("VidyoConnector initialized.");
            _localHandle = localHandle;

            _connector = new Connector(IntPtr.Zero, Connector.ConnectorViewStyle.ConnectorviewstyleDefault, 8, "all@VidyoClient all@LmiCsEpClient", "VidyoClient.log", 0);

            // This should be called on each window resizing.

            // Adding Null's to devices collection, which is 'None' in GUI. Selecting 'None' means no device will be used.
            LocalCameras.Add(new LocalCameraModel(null));
            LocalMicrophones.Add(new LocalMicrophoneModel(null));
            LocalSpeakers.Add(new LocalSpeakerModel(null));

            // Registering to events we want to handle.
            _connector.RegisterLocalCameraEventListener(new LocalCameraListener(this));
            _connector.RegisterLocalWindowShareEventListener(new LocalWindowShareListener(this));
            _connector.RegisterLocalMicrophoneEventListener(new LocalMicropfoneListener(this));
            _connector.RegisterLocalSpeakerEventListener(new LocalSpeakerListener(this));
            _connector.RegisterParticipantEventListener(new ParticipantListener(this));
            _connector.RegisterLocalMonitorEventListener(new LocalMonitorListener(this));
            _connector.RegisterRemoteCameraEventListener(new RemoteCameraListener(this));
            _connector.RegisterMessageEventListener(new MessageListener(this));

            // We are not in call when application started.
            ConnectionState = ConnectionState.NotConnected;

            // On application start Vidyo turns on default camera.
            IsCameraOn = true;
            // On application start Vidyo turns on default microphone.
            IsMicrophoneOn = true;
            EnableDebug    = false;

            ParseCommandLineArgs();
        }
示例#9
0
        /// <summary>
        /// Entry point. Prepares and launches Vidyo functionality.
        /// </summary>
        /// <param name="handle">Control's handler where video will be rendered.</param>
        /// <param name="width">Width of video area.</param>
        /// <param name="height">Height of video area.</param>
        public void Init(IntPtr handle, uint width, uint height)
        {
            ConnectorPKG.Initialize();
            Log.Info("VidyoConnector initialized.");

            _connector = new Connector(handle, Connector.ConnectorViewStyle.ConnectorviewstyleDefault, 8, "all@VidyoClient", "VidyoClient.log", 0);

            // This should be called on each window resizing.
            _connector.ShowViewAtPoints(handle, 0, 0, width, height);
            Log.Info(string.Format("Showing view with width={0} and height={1}", width, height));

            // Adding Null's to devices collection, which is 'None' in GUI. Selecting 'None' means no device will be used.
            LocalCameras.Add(new LocalCameraModel(null));
            LocalMicrophones.Add(new LocalMicrophoneModel(null));
            LocalSpeakers.Add(new LocalSpeakerModel(null));

            // Registering to events we want to handle.
            _connector.RegisterLocalCameraEventListener(new LocalCameraListener(this));
            _connector.RegisterLocalWindowShareEventListener(new LocalWindowShareListener(this));
            _connector.RegisterLocalMicrophoneEventListener(new LocalMicropfoneListener(this));
            _connector.RegisterLocalSpeakerEventListener(new LocalSpeakerListener(this));
            _connector.RegisterParticipantEventListener(new ParticipantListener(this));
            _connector.RegisterLocalMonitorEventListener(new LocalMonitorListener(this));
            //_connector.RegisterLogEventListener(new LogListener(this), "*@VidyoClient");
            _connector.RegisterMessageEventListener(new MessageListener(this));

            // We are not in call when application started.
            ConnectionState = ConnectionState.NotConnected;

            // On application start Vidyo turns on default camera.
            IsCameraOn = true;
            // On application start Vidyo turns on default microphone.
            IsMicrophoneOn = true;
            EnableDebug    = false;

            ParseCommandLineArgs();
        }