Exemple #1
0
        private void RunVideo(int Number)
        {
            switch (PlayStatus)
            {
            case MediaStatus.Play:
                return;

            case MediaStatus.Pause:
                if (WarningGrid.Opacity > 0)
                {
                    WarningGrid.BeginAnimation(OpacityProperty, OpacityAnimation(WarningGrid.Opacity, 0, 10));
                }
                else
                {
                    WarningGrid.BeginAnimation(OpacityProperty, OpacityAnimation(WarningGrid.Opacity, 1, 10));
                    WarningMessage();
                    return;
                }
                break;

            case MediaStatus.Stop:
                ImageGrid.BeginAnimation(OpacityProperty, OpacityAnimation(ImageGrid.Opacity, 0, 500));
                break;
            }

            mediaElement.Source = null;
            mediaElement.Source = new Uri(Path.GetFullPath(Config.GetConfigValue("video_" + Number.ToString())));

            StopList = Config.GetStringList("video_" + Number.ToString() + "_stop");

            mediaElement.Play();
            PlayStatus = MediaStatus.Play;
        }
Exemple #2
0
 private void mediaElement_MediaEnded(object sender, RoutedEventArgs e)
 {
     PlayStatus = MediaStatus.Stop;
     ImageGrid.BeginAnimation(OpacityProperty, OpacityAnimation(ImageGrid.Opacity, 1, 500));
 }