private void dispatcherTick(object sender, EventArgs e) { MediaControl.PrintTimer(Video, lblTime); if (MediaControl.subtitleState) { MediaControl.PrintSubtitle(lblSubtitle); if (tt.Status != TaskStatus.Running) { tt = new Task(() => MediaControl.EditSubtitleAsync(Video, lblSubtitle, subtitle)); tt.Start(); } } }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (!(textBoxOpenVideo.Text == "VideoFile" && textBoxOpenSrt.Text == "SubtitleFile")) { Video.Source = new Uri(textBoxOpenVideo.Text); MediaControl.InitStaticVar(); InitDispatcherTimer(); InitSubtitle(); InitTask(); Video.ScrubbingEnabled = true; Video.Pause(); gridMenu.Opacity = 0; gridPlayer.Opacity = 1; } else { textBoxOpenVideo.BorderBrush = Brushes.Red; textBoxOpenSrt.BorderBrush = Brushes.Red; } }
private void Window_KeyDown(object sender, KeyEventArgs e) { switch (e.Key) { case Key.Space: MediaControl.Play(Video, pctPlay); break; case Key.Left: MediaControl.MooveBackward(Video); break; case Key.Right: MediaControl.MooveForward(Video); break; case Key.C: MediaControl.ActivateCc(lblSubtitle); break; } }
private void btnPlay_Click(object sender, RoutedEventArgs e) { MediaControl.Play(Video, pctPlay); }
private void InitTask() { tt = new Task(() => MediaControl.EditSubtitleAsync(Video, lblSubtitle, subtitle)); }
private void Button_Click(object sender, RoutedEventArgs e) { MediaControl.ActivateCc(lblSubtitle); }
private void btnForward_Click(object sender, RoutedEventArgs e) { MediaControl.MooveForward(Video); }