}//)); #endregion #region События public void MP_MediaOpened(object sender, EventArgs e) { MP.Play(); IsPlaying = true; timer.Start(); OnPropertyChanged(); }
/// <summary> Изменение состояние воспроизведения </summary> public void Play() { if (MP.Source != null) { MP.Play(); timer.Start(); IsPlaying = true; OnPropertyChanged(); } }
private void FinalTimer_Tick(object sender, EventArgs e) { if (game.final == true) { this.Show(); FinalTimer.Stop(); //MP.Source = new Uri(@"pack://*****:*****@"video/begin.wmv", UriKind.RelativeOrAbsolute); //string filename = Game.Properties.Resources.Начало.ToString(); //MP.Source = new Uri(filename, UriKind.RelativeOrAbsolute); MP.Volume = 1; MP.Play(); MP.SpeedRatio = 20; } }
public Window1() { InitializeComponent(); //timerStart(); MP.MediaOpened += MP_MediaOpened; MP.MediaEnded += MP_MediaEnded; if (game.final == false) { MP.Source = new Uri("video/begin.wmv", UriKind.RelativeOrAbsolute); //MP.Source = new Uri(@"pack://*****:*****@"pack://application:,,,/video/predhistor.wmv", UriKind.Absolute); MP.Play(); MP.SpeedRatio = 20; FinalTimer = new System.Windows.Threading.DispatcherTimer(); FinalTimer.Tick += new EventHandler(FinalTimer_Tick); FinalTimer.Interval = new TimeSpan(0, 0, 0, 0, 400); }
private void MP_MediaOpened(object sender, RoutedEventArgs e) { MP.Play(); }