private void MediaPlayer_FatalMediaErrorOccurred(object sender, Windows.Media.Playback.MediaPlayerFailedEventArgs e)
 {
     App.Dispatcher.RunWhenIdleAsync(() =>
     {
         IsPlaying      = NepApp.MediaPlayer.IsPlaying;
         IsMediaEngaged = NepApp.MediaPlayer.IsMediaEngaged;
     });
 }
 private async void MediaPlayer_FatalMediaErrorOccurred(object sender,
                                                        Windows.Media.Playback.MediaPlayerFailedEventArgs e)
 {
     if (!await App.GetIfPrimaryWindowVisibleAsync())
     {
         NepApp.UI.Notifier.ShowErrorToastNotification(null, "Uh-Oh!",
                                                       !NepApp.Network.IsConnected ? "Network connection lost!" : "An unknown error occurred.");
     }
 }
 private async void MediaPlayer_FatalMediaErrorOccurred(object sender, Windows.Media.Playback.MediaPlayerFailedEventArgs e)
 {
     await NepApp.UI.ShowInfoDialogAsync("Uh-Oh!", !NepApp.Network.IsConnected? "Network connection lost!" : "An unknown error occurred.");
 }
Example #4
0
 private async void MediaPlayer_MediaFailed(Windows.Media.Playback.MediaPlayer sender, Windows.Media.Playback.MediaPlayerFailedEventArgs args)
 {
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
     {
         ContentDialog dialog = new ContentDialog
         {
             Title      = "错误",
             Content    = "无法缓冲该MV\r\r原因如下:\r\r" + args.ErrorMessage,
             Background = Application.Current.Resources["DialogAcrylicBrush"] as Brush
         };
         await dialog.ShowAsync();
     });
 }
Example #5
0
 private void MediaPlayer_MediaFailed(Windows.Media.Playback.MediaPlayer sender, Windows.Media.Playback.MediaPlayerFailedEventArgs args)
 {
     LogMessage("MediaPlayer media failed event");
 }
Example #6
0
 void Player_MediaFailed(Windows.Media.Playback.MediaPlayer sender, Windows.Media.Playback.MediaPlayerFailedEventArgs args)
 {
     Ended.TrySetException(new Exception("Failed to play audio > " + args.ErrorMessage));
 }