Esempio n. 1
0
        private void SwitchingVideoDeviceEventHandler(VideoDeviceEventContext eventContext)
        {
            MsPlayerContainer.Visibility = Visibility.Visible;

            MsPlayer.OpenDevice(eventContext.OwnerVideoDevice);

            _desktopWindowCollector?.SetWindowHandle(MsPlayerContainer.Handle);
            //_setupVideoLiveAndRecordingDevices?.SetVideoDevice(eventContext.OwnerVideoDevice);
        }
Esempio n. 2
0
        private void SwitchDemonstrationSceneEventHandler(SwitchDemonstrationSceneContext context)
        {
            _desktopWindowCollector.PushingData -= _desktopWindowCollector_PushingData;

            switch (context.SceneType)
            {
            case DemonstratioType.PPT:
                AllSceneHidden();
                _player.Pause();
                PPTViewer.OpenPPT(context.UseDevice.ToString());
                DemonstrationPPTScene.Visibility = Visibility;
                _desktopWindowCollector.SetWindowHandle(DemonstrationPPTScene.Handle);
                break;

            case DemonstratioType.VideoDevice:
                AllSceneHidden();
                _player.Pause();
                DemonstrationVideoDeviceScene.Visibility = Visibility.Visible;
                MsPlayer.OpenDevice(context.UseDevice as IVideoDevice);
                _desktopWindowCollector.SetWindowHandle(DemonstrationVideoDeviceScene.Handle);
                break;

            case DemonstratioType.Image:
                _player.Pause();
                AllSceneHidden();
                if (_imagePath != context.UseDevice.ToString())
                {
                    _imagePath = context.UseDevice.ToString();
                    BitmapImage bitmap = new BitmapImage(new Uri(_imagePath));
                    ImageControl.ImageSource = bitmap;
                }
                DefaultScene.Visibility = Visibility.Visible;
                _desktopWindowCollector.SetWindowHandle(DefaultScene.Handle);
                break;

            case DemonstratioType.Video:
                if (context.UseDevice.ToString() != _videoPath)
                {
                    _videoPath = context.UseDevice.ToString();
                    AllSceneHidden();
                    _player.Open(new Uri(_videoPath));
                }
                _player.Play();
                DemonstrationVideoScene.Visibility = Visibility.Visible;
                _desktopWindowCollector.SetWindowHandle(DemonstrationVideoScene.Handle);
                break;

            default:
                AllSceneHidden();
                DefaultScene.Visibility = Visibility.Visible;
                _desktopWindowCollector.SetWindowHandle(DefaultScene.Handle);
                break;
            }
        }