private static void CommandManager_PreviousReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPreviousReceivedEventArgs args) { if (LocalSettings.Instance.InvertSkipControls && Position > AppSettings.Instance.RewindStep) { args.Handled = true; ForcePosition(Position - AppSettings.Instance.RewindStep); } }
private static void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { if (LocalSettings.Instance.InvertSkipControls && (Duration - Position > AppSettings.Instance.ForwardStep)) { args.Handled = true; ForcePosition(Position + AppSettings.Instance.ForwardStep); } }
private void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { _nextPressCount++; if (_nextPressCount > 5) { sender.NextBehavior.EnablingRule = MediaCommandEnablingRule.Never; // Perform app tasks while the Next button is disabled } }
private void MediaPlayerCommandManager_PreviousReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPreviousReceivedEventArgs args) { if (PlayingSound.MediaPlayer.PlaybackSession.Position.Seconds > 5) { args.Handled = true; // Move the state of the current sound to the beginning PlayingSound.MediaPlayer.PlaybackSession.Position = new TimeSpan(0); } }
private void CommandManager_PreviousReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPreviousReceivedEventArgs args) { if (PlayingService.IsPlayingSong) { PlayingService.PlayLastSongs(); } else { PlayingService.PlayLastRadio(); } }
private async void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { Tuple <int, int> tuple = _chapter.NextChapter(); if (tuple != null) { MainPage.TheMainPage.SetTabItem(tuple.Item1, tuple.Item2, 0, false); } }); }
private static void CommandManager_PlayReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPlayReceivedEventArgs args) { args.Handled = true; //if ((App.Current as App).IsInBackground) //{ // await Playlist.PreparePlaylistAsync(); // return; //} Play(); }
//<SnippetPreviousReceived> private async void CommandManager_PreviousReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPreviousReceivedEventArgs args) { var deferral = args.GetDeferral(); MediaPlaybackItem mediaPlaybackItem = await GetPreviousStation(); if (args.Handled != true) { args.Handled = true; sender.MediaPlayer.Source = mediaPlaybackItem; sender.MediaPlayer.Play(); } deferral.Complete(); }
private void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { if (args.Handled != true) { args.Handled = true; PlayDone(Player.Current); if (Player?.CanGoNext ?? false) { Player.GoNext(); } } }
private void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { if (queue.Count >= 1) { history.Push(currentSong); currentSong = queue.Pop(); if (window.CurrentSourcePageType.Equals(typeof(QueueView))) { window.Navigate(typeof(QueueView)); } else { window.Navigate(typeof(SongView)); } } }
private void CommandManager_PlayReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPlayReceivedEventArgs args) { Play(); }
private static void CommandManager_PauseReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPauseReceivedEventArgs args) { args.Handled = true; Pause(true); }
private void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { Next(); }
private async void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { await SetNextVideo(); }
private async void CommandManager_PreviousReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPreviousReceivedEventArgs args) { await SetPreviousVideo(); }
private void CommandManager_NextReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerNextReceivedEventArgs args) { Next(); }
private void CommandManager_PreviousReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPreviousReceivedEventArgs args) { Previous(); }
private void _commandManagerPlayReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPlayReceivedEventArgs args) { args.Handled = true; SMTCCommandReceived?.Invoke(SMTCCommandType.Play); }
private void CommandManager_PreviousReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPreviousReceivedEventArgs args) { Previous(); }
private void CommandManager_PlayReceived(MediaPlaybackCommandManager sender, MediaPlaybackCommandManagerPlayReceivedEventArgs args) { Play(); }