Example #1
0
 private void Page_KeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (mediaPlayerElement.Visibility == Visibility.Visible && e.Key == VirtualKey.Escape)
     {
         MediaPlayerHost.Pause(false);
         VideoPlayerGrid.Visibility = Visibility.Collapsed;
     }
 }
Example #2
0
        private static void Timer_Tick(object sender, object e)
        {
            var diff  = DateTime.Now.Subtract(StartDate);
            var total = LocalSettings.Instance.SleepTimerDuration;

            if (diff.TotalMinutes > total)
            {
                MediaPlayerHost.Pause(false);
                Dispose();
            }
            OnTick?.Invoke();
        }
Example #3
0
 private void Pause_OnClick(object sender, RoutedEventArgs e)
 {
     MediaPlayerHost.Pause(true);
 }