Пример #1
0
 private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
 {
     if (PlaybackManager.PlaybackState != PlaybackManager.StreamingPlaybackState.Buffering)
     {
         PlaybackManager.SetState(PlaybackState.Stopped);
         PlaybackManager.PlayTrack(TrackManager.CurrentTrack = TrackManager.Queue.Dequeue());
     }
 }
Пример #2
0
        private void ToggleButton_OnChecked(object sender, RoutedEventArgs e)
        {
            var tb = sender as ToggleButton;

            if (tb?.IsChecked == null)
            {
                return;
            }
            if (PlaybackManager.PlaybackState == PlaybackManager.StreamingPlaybackState.Stopped)
            {
                PlaybackManager.PlayTrack(TrackManager.CurrentTrack = TrackManager.Queue.Dequeue());
            }
            else if (PlaybackManager.PlaybackState != PlaybackManager.StreamingPlaybackState.Buffering)
            {
                PlaybackManager.SetState(tb.IsChecked.Value ? PlaybackState.Playing : PlaybackState.Paused);
            }
        }
Пример #3
0
        private async void Index_OnLoaded(object sender, RoutedEventArgs e)
        {
            await LoadListenNowSituations();
            await LoadListenNowData();

            var streamRequest = await new ListPromotedTracks().GetAsync(new ResultListRequest(SessionManager.MobileSession));

            foreach (var track in streamRequest.Data.Items)
            {
                var url = await new GetStreamUrl().GetAsync(new StreamUrlGetRequest(SessionManager.MobileSession, track));
                TrackManager.CurrentTrack = track;
                PlaybackManager.PlayTrack(url);
                break;
            }

            LoadingOverlay.Visibility = Visibility.Visible;
            LoadingOverlay.SetSolid();

            LoadingOverlay.Visibility = Visibility.Hidden;
        }