public void ResumeVideo() { try { if (_statusVideo == StatusVideoEnum.Lunched) { _service.Play(); ComPrortSender.Send(_currentVideo.FileMotion, Terminal, App.Current, App.SendMessage, App.SendException); _timerEnd.Start(); } else { ComPortPackagesService.Resume(); _timerEnd.Start(); _service.Play(); VideoBanner.StartPlayer(); } Observer.StartObserv(); _statusVideo = StatusVideoEnum.Started; } catch (Exception ex) { App.SendException(ex); MessageBox.Show($"Video not runned please wait. | {ex.Message}"); } }
public void LaunchingVideo() { _statusVideo = StatusVideoEnum.Lunched; _videoProcessor.LaunchProcess(); Btn_Start.IsEnabled = true; Btn_Stop.IsEnabled = true; // Btn_Play.IsEnabled = true; }
public void PauseVideo() { if (_statusVideo == StatusVideoEnum.Started) { _service.Pause(); VideoBanner.PausePlayer(); ComPortPackagesService.Pause(); _timerEnd.Stop(); Thread.Sleep(300); _statusVideo = StatusVideoEnum.Pause; } else { MessageBox.Show("Видео не началось производиться"); } }
private void Btn_Pause_Click(object sender, RoutedEventArgs e) { if (_statusVideo == StatusVideoEnum.Started) { Pause(); _statusVideo = StatusVideoEnum.Pause; Thread.Sleep(500); Btn_Pause.IsEnabled = false; Btn_Start.IsEnabled = true; SetObservPause(); Observer.ObservIteration(); } else { //System.Windows.MessageBox.Show("Видео не запушено"); } }
public void StopVideo() { try { _timerEnd.Stop(); _videoProcessor.StopProcess(); if (_statusVideo == StatusVideoEnum.Started || _statusVideo == StatusVideoEnum.Pause) { ComPortPackagesService.Stop(); Thread.Sleep(250); ComPrortSender.StartMoutionPosition(); } _service.Stop(); _videoProcessor.Dispose(); _statusVideo = StatusVideoEnum.NotLunched; } catch (Exception ex) { } }