Inheritance: System.EventArgs
Ejemplo n.º 1
0
 private async void OnStatusChanged(object sender, StatusChangedEventArgs e)
 {
     await
         CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
             () =>
             {
                 PlayerState.Text = Enum.GetName(typeof(MediaPlayerStatus), e.Status);
                 switch (CrossMediaManager.Current.Status)
                 {
                     case MediaPlayerStatus.Stopped:
                         Progress.Value = 0;
                         break;
                     case MediaPlayerStatus.Paused:
                         break;
                     case MediaPlayerStatus.Playing:
                         Progress.Maximum = 1;
                         break;
                     case MediaPlayerStatus.Buffering:
                         break;
                         case MediaPlayerStatus.Loading:
                         break;
                     case MediaPlayerStatus.Failed:
                         break;
                     default:
                         throw new ArgumentOutOfRangeException();
                 }
             });
 }
		private void OnPlayingHandler(StatusChangedEventArgs args)
		{
			if (args.Status == MediaPlayerStatus.Playing)
			{
				CancelPlayingHandler();
				StartPlayingHandler();
			}
			if (args.Status == MediaPlayerStatus.Stopped || args.Status == MediaPlayerStatus.Failed || args.Status == MediaPlayerStatus.Paused)
				CancelPlayingHandler();
		}
 private void OnStatusChangedHandler(StatusChangedEventArgs args)
 {
     if (args.Status == MediaPlayerStatus.Buffering)
     {
         CancelBufferingTask();
         StartBufferingSchedule();
     }
     if (args.Status == MediaPlayerStatus.Stopped || args.Status == MediaPlayerStatus.Failed)
         CancelBufferingTask();
 }
 protected virtual void OnStatusChanged(StatusChangedEventArgs e)
 {
     StatusChanged?.Invoke(this, e);
 }
 private void OnStatusChanged(object sender, StatusChangedEventArgs e)
 {
     if (sender != CurrentPlaybackManager) return;
     MediaNotificationManager?.UpdateNotifications(MediaQueue.Current, e.Status);
     StatusChanged?.Invoke(sender, e);
 }
 private void OnStatusChangedHandler(StatusChangedEventArgs args)
 {
     if (args.Status == MediaPlayerStatus.Buffering)
     {
         CancelBufferingTask();
          Task.Run(() => OnBuffering(), _onBufferingCancellationSource.Token);
     }
     if (args.Status == MediaPlayerStatus.Stopped || args.Status == MediaPlayerStatus.Failed)
         CancelBufferingTask();
 }