void PauseButton_Click(object sender, RoutedEventArgs e) { if (PauseButton.Content.ToString() == "Pause") { SmoothPlayer.Pause(); seekbarTimer.Stop(); PauseButton.Content = "Play"; } else { SmoothPlayer.Play(); seekbarTimer.Start(); PauseButton.Content = "Pause"; } }
private void PlayButton_Click(object sender, RoutedEventArgs e) { //Monitor the state of the content to determine the right action to take on this button being clicked //and then change the text to reflect the next action switch (SmoothPlayer.CurrentState) { case SmoothStreamingMediaElementState.Playing: SmoothPlayer.Pause(); PlayButton.Content = "Play"; break; case SmoothStreamingMediaElementState.Stopped: case SmoothStreamingMediaElementState.Paused: SmoothPlayer.Play(); PlayButton.Content = "Pause"; // CacheSize.Text = "Cache size: " + tempSize.ToString(); break; } }
private void PlayButton_Click(object sender, RoutedEventArgs e) { switch (SmoothPlayer.CurrentState) { case SmoothStreamingMediaElementState.Playing: SmoothPlayer.Pause(); PlayButton.Content = "Play"; break; case SmoothStreamingMediaElementState.Paused: SmoothPlayer.Play(); PlayButton.Content = "Pause"; break; case SmoothStreamingMediaElementState.Stopped: SmoothPlayer.Play(); PlayButton.Content = "Pause"; break; } }