// To know when Player View changes the video state.
        void PlayerView_StateChanged(object sender, PlayerViewStateChangedEventArgs e)
        {
            Console.WriteLine($"Player changed state to {e.State}");

            if (e.State == PlayerState.Queued)
            {
                BtnPlayPause.SetTitle("Play Video", UIControlState.Normal);
                BtnPlayPause.Enabled = true;
                BtnPlayPause.SetTitleColor(YouTubeManager.YouTubeColor, UIControlState.Normal);
            }
        }
        // To know when Player View changes the video state.
        void PlayerView_StateChanged(object sender, PlayerViewStateChangedEventArgs e)
        {
            Console.WriteLine($"Player changed state to {e.State}");

            if (e.State == PlayerState.Queued)
            {
                BtnPlayPause.SetTitle("Play", UIControlState.Normal);
                EnableButton(BtnPlayPause);
            }

            if (e.State == PlayerState.Playing)
            {
                BtnPlayPause.SetTitle("Pause", UIControlState.Normal);
                EnableButton(BtnPlayPause);
            }
        }
Ejemplo n.º 3
0
 private void YouTubePlayerView_StateChanged(object sender, PlayerViewStateChangedEventArgs e)
 {
     YoutubeXamarin.Estado = e.State.ToString();
 }