/// <summary>
 /// Evento llamado cuando se pulsa el botón de Play/Pause (Solo TV)
 /// </summary>
 private void Play_Clicked(object sender, EventArgs e)
 {
     if (mm.State == MediaPlayerState.Stopped || mm.State == MediaPlayerState.Paused)
     {
         mm.Play();
     }
     else if (mm.State == MediaPlayerState.Playing)
     {
         mm.Pause();
     }
 }
Exemplo n.º 2
0
        //private Song lastSong;
        private async void PlaySong(Song obj)
        {
            if (Singleton.Instance.lastSong != null)
            {
                if (Singleton.Instance.lastSong.SongId != obj.SongId)
                {
                    await media.Pause();

                    media.MediaQueue.Clear();
                    Singleton.Instance.lastSong.IsPlaying = false;

                    Singleton.Instance.lastSong           = obj;
                    Singleton.Instance.lastSong.IsPlaying = true;
                    var path = new System.Uri("/assets/music/" + obj.SongAudio).AbsolutePath;
                    await media.Play(Singleton.Instance.AriaUrl + path);
                }
                else
                {
                    if (Singleton.Instance.lastSong.IsPlaying == true)
                    {
                        Singleton.Instance.lastSong.IsPlaying = false;
                        await media.Pause();
                    }
                    else
                    {
                        Singleton.Instance.lastSong.IsPlaying = true;
                        await media.Play();
                    }
                }
            }
            else
            {
                Singleton.Instance.lastSong = obj;
                var path = new System.Uri("/assets/music/" + obj.SongAudio).AbsolutePath;
                await media.Play(Singleton.Instance.AriaUrl + path);

                Singleton.Instance.lastSong.IsPlaying = true;
            }
        }
Exemplo n.º 3
0
        public static Task PlayPause(this IMediaManager mediaManager)
        {
            var status = mediaManager.State;

            if (status == MediaPlayerState.Paused || status == MediaPlayerState.Stopped)
            {
                return(mediaManager.Play());
            }
            else
            {
                return(mediaManager.Pause());
            }
        }
Exemplo n.º 4
0
 public void Pause()
 {
     player.Pause();
 }
Exemplo n.º 5
0
 private void Button_Clicked(object sender, EventArgs e)
 {
     //play
     _mediaManager.Pause();
     //   MessagingCenter.Instance.Send<object, bool>(this, "PlayerMessage", false);
 }
Exemplo n.º 6
0
 public virtual async Task Pause()
 {
     await _mediaManager.Pause();
 }