예제 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (SettingsService.Current.IsStreamingEnabled)
            {
            }
            else
            {
                Download_Click(null, null);
                return;
            }

            var audio = GetContent(_message?.Content);

            if (audio == null)
            {
                return;
            }

            if (_message.IsEqualTo(_playbackService.CurrentItem))
            {
                if (_playbackService.PlaybackState == MediaPlaybackState.Paused)
                {
                    _playbackService.Play();
                }
                else
                {
                    _playbackService.Pause();
                }
            }
            else
            {
                _playbackService.Play(_message);
            }
        }
예제 #2
0
 private void Toggle_Click(object sender, RoutedEventArgs e)
 {
     if (_playbackService.PlaybackState == MediaPlaybackState.Playing)
     {
         _playbackService.Pause();
     }
     else
     {
         _playbackService.Play();
     }
 }
 public void PausePlayback()
 {
     if (_currentMode == ApplicationMode.Play)
     {
         _playbackService.Pause();
     }
     else
     {
         Logger.Warn("Application not in playback");
     }
 }
예제 #4
0
 private void Button_Clicked(object sender, EventArgs e)
 {
     if (isPlaying)
     {
         playbackService.Pause();
     }
     else
     {
         playbackService.Play();
     }
     isPlaying = !isPlaying;
 }
예제 #5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var voiceNote = GetContent(_message?.Content);

            if (voiceNote == null)
            {
                return;
            }

            var file = voiceNote.Voice;

            if (file.Local.IsDownloadingActive)
            {
                _protoService.Send(new CancelDownloadFile(file.Id, false));
            }
            else if (file.Remote.IsUploadingActive || _message.SendingState is MessageSendingStateFailed)
            {
                _protoService.Send(new DeleteMessages(_message.ChatId, new[] { _message.Id }, true));
            }
            else if (file.Local.CanBeDownloaded && !file.Local.IsDownloadingActive && !file.Local.IsDownloadingCompleted)
            {
                //_protoService.DownloadFile(file.Id, 32);
                _playbackService.Play(_message);
            }
            else
            {
                if (_message.IsEqualTo(_playbackService.CurrentItem))
                {
                    if (_playbackService.PlaybackState == MediaPlaybackState.Paused)
                    {
                        _playbackService.Play();
                    }
                    else
                    {
                        _playbackService.Pause();
                    }
                }
                else
                {
                    _playbackService.Play(_message);
                }
            }
        }
예제 #6
0
        private void TogglePlayPause()
        {
            switch (_playbackService.PlaybackState)
            {
            case MediaPlaybackState.Playing:
            {
                _playbackService.Pause();
                PlayPauseIcon = Icon.GetIcon("PlayIcon");
            }
            break;

            case MediaPlaybackState.Paused:
            {
                _playbackService.Play();
                PlayPauseIcon = Icon.GetIcon("PauseIcon");
            }
            break;
            }
        }
예제 #7
0
        public async Task <IActionResult> Paus()
        {
            var statuscode = await _playbackService.Pause();

            return(View("Index"));
        }