Beispiel #1
0
 private void HandleMediaFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     Log.Logger.Debug("Media failed");
     OnMediaChangeEvent(new MediaEventArgs {
         MediaItemId = _mediaItemId, Change = MediaChange.Stopped
     });
 }
        async void player_MediaFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
        {
            var now = DateTime.Now;

            var exm = e.ErrorException.InnermostMessage();

            ExceptionMsg = $"MediaFailed: {exm}";

            CurMediaUnit.GenreID = 15; // exception: do not play next time ...until deliberately selected and fixed.
            if (CurMediaUnit.Notes == null || !CurMediaUnit.Notes.Contains(exm))
            {
                var len    = (CurMediaUnit.Notes == null ? 0 : CurMediaUnit.Notes.Length);
                var errmsg = $" {now} {exm} ";
                if (errmsg.Length < (1024 - len))
                {
                    CurMediaUnit.Notes += $" {now} {exm} ";
                }
                else if (200 > (1024 - len))
                {
                    CurMediaUnit.Notes += $" {now} {exm} ".Substring(0, 199);
                }
            }

            if (!File.Exists(CurMediaUnit.PathFileExtOrg))
            {
                if (File.Exists(CurMediaUnit.PathFileExtOrg.ToLower().Replace("m:\\", "c:\\1\\m\\")))
                {
                    _player.Source = new Uri(CurMediaUnit.PathFileExtOrg = CurMediaUnit.PathFileExtOrg.ToLower().Replace("m:\\", "c:\\1\\m\\"));
                    saveAllToDb_Speak();
                    ExceptionMsg = $"MediaFailed: SOLVED: renamed M:\\ to C:\\1\\M\\ {_player.Source.LocalPath} ";

                    await Task.Delay(500);

                    synth.Speak("Restarting...");
                    playAndStartCounters();
                    return;
                }
                ExceptionMsg           = string.Format("MediaFailed: File does not exist; marking that in DB.  ");
                CurMediaUnit.DeletedAt = now;
                CurMediaUnit.Notes     = FileSysProcessor.SAfeAddNote(CurMediaUnit, $" Found missing trying to play on {now.ToShortDateString()}.");
            }

            saveAllToDb_Speak();

            if (canMoveNext)
            {
                onMoveNext(null);
                playAndStartCounters();
            }
        }
Beispiel #3
0
 void OnImageFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     Log.Warning("Image loading", $"Image failed to load: {e.ErrorException.Message}");
     Element?.SetIsLoading(false);
 }
Beispiel #4
0
 void MediaControl_MediaFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     Load_New_Media();
 }
Beispiel #5
0
 private void MediaElement_MediaFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     LoadingIndicator.Visibility = System.Windows.Visibility.Collapsed;
     ViewModel.ErrorMessage      = e.ErrorException.Message;
 }
Beispiel #6
0
 private void Image_ImageFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
 }
 private void MediaFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     Helpers.ConsoleLogger.Error($"{e.ErrorException.GetType().Name}: {e.ErrorException.Message}");
     PlayNextSong();
 }
Beispiel #8
0
 void MediaFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     Trace.WriteLine("Media failed.");
 }
 void MediaPlayer_MediaFaild(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     All.Class.Error.Add(e.ErrorException);
 }
Beispiel #10
0
 void detector_MediaFailed(object sender, System.Windows.ExceptionRoutedEventArgs e)
 {
     throw new NotImplementedException();
 }