Esempio n. 1
0
        private void SystemShutdownHandler(bool isClosed)
        {
            try
            {
                MsPlayer.CloseDevice();
            }
            catch { }
            try
            {
                syncVideoPlayState(false);
                _player.Stop();
            }
            catch { }

            try
            {
                PPTViewer.Close();
            }
            catch { }
            try
            {
                _desktopWindowCollector.PushingData -= _desktopWindowCollector_PushingData;
            }
            catch { }
            try
            {
                _desktopWindowCollector.Dispose();
            }
            catch { }
        }
Esempio n. 2
0
        private void SwitchingVideoDeviceEventHandler(VideoDeviceEventContext eventContext)
        {
            MsPlayerContainer.Visibility = Visibility.Visible;

            MsPlayer.OpenDevice(eventContext.OwnerVideoDevice);

            _desktopWindowCollector?.SetWindowHandle(MsPlayerContainer.Handle);
            //_setupVideoLiveAndRecordingDevices?.SetVideoDevice(eventContext.OwnerVideoDevice);
        }
Esempio n. 3
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;
            }
        }
Esempio n. 4
0
        private void SystemShutdown(bool isClosing)
        {
            if (isClosing)
            {
                MsPlayer.CloseDevice();
            }

            try
            {
                _desktopWindowCollector.Dispose();
            }
            catch { }
        }