private void btnStop_Click(object sender, RoutedEventArgs e) { MediaEL.Stop(); MediaEL.Play(); Thread.Sleep(50); MediaEL.Pause(); btnPlay.Content = "Play"; IsPlaying(false); btnPlay.IsEnabled = true; }
private void InitialPlay() { IsPlaying(true); if (btnPlay.Content.ToString() == "Play") { MediaEL.Play(); btnPlay.Content = "Pause"; } else { MediaEL.Pause(); btnPlay.Content = "Play"; } }
private void btnPlay_Click(object sender, RoutedEventArgs e) { IsPlaying(true); if (btnPlay.Content.ToString() == "Play") { MediaEL.Play(); btnPlay.Content = "Pause"; } else { MediaEL.Pause(); btnPlay.Content = "Play"; } }
public void btnPlay_Click(object sender, RoutedEventArgs e) { // VideoToFrames.ReadFromVideo(); IsPlaying(true); if (btnPlay.Content.ToString() == "Play") { MediaEL.Play(); btnPlay.Content = "Pause"; } else { MediaEL.Pause(); btnPlay.Content = "Play"; } }
private void btnPlay_Click(object sender, RoutedEventArgs e) { IsPlaying(true); string name = ((Image)btnPlay.Content).Name; if (name.Equals("play")) { MediaEL.Play(); btnPlay.Content = playButtonImageList[0]; } else if (name.Equals("pause")) { MediaEL.Pause(); btnPlay.Content = playButtonImageList[1]; } }
private void btnScreenShot_Click(object sender, RoutedEventArgs e) { MediaEL.Pause(); btnPlay.Content = "Play"; string sMessageBoxText = "Do you want to use this screenshot?"; string sCaption = "Confirm screenshot"; MessageBoxButton btnMessageBox = MessageBoxButton.YesNo; MessageBoxImage icnMessageBox = MessageBoxImage.Question; MessageBoxResult rsltMessageBox = MessageBox.Show(sMessageBoxText, sCaption, btnMessageBox, icnMessageBox); switch (rsltMessageBox) { case MessageBoxResult.Yes: byte[] screenshot = MediaEL.GetScreenShot(1, 90); string baseURI = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string pathString = System.IO.Path.Combine(baseURI, "ScreenShots"); System.IO.Directory.CreateDirectory(pathString); using (FileStream fileStream = new FileStream(baseURI + @"\ScreenShots\Capture" + n + ".jpg", FileMode.Create, FileAccess.Write, FileShare.ReadWrite)) { BinaryWriter binaryWriter = new BinaryWriter(fileStream); binaryWriter.Write(screenshot); fileStream.Close(); } this.Visibility = Visibility.Hidden; this.IsEnabled = false; MainWindow two = new MainWindow(this, n, seekBar.Value); if (two.ShowDialog() == false) { this.Visibility = Visibility.Visible; this.IsEnabled = true; } n++; break; case MessageBoxResult.No: MediaEL.Play(); btnPlay.Content = "Pause"; break; } }