public void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasResumed)
 {
     this.player = player;
     player.SetPlayerStyle(YouTubePlayerPlayerStyle.Chromeless);
     player.SetPlayerStateChangeListener(new VideoListener()
     {
         Loaded = () =>
         {
             state = State.VIDEO_CUED;
         },
         VideoEnded = () =>
         {
             state = State.VIDEO_ENDED;
             imageWallView.ShowImage(videoCol, videoRow);
             playerView.Visibility = ViewStates.Invisible;
         },
         Error = (errorReason) =>
         {
             if (errorReason == YouTubePlayerErrorReason.UnexpectedServiceDisconnection)
             {
                 // player has encountered an unrecoverable error - stop the demo
                 flipDelayHandler.RemoveCallbacksAndMessages(null);
                 state = State.UNINITIALIZED;
                 thumbnailLoader.Release();
                 thumbnailLoader = null;
                 player          = null;
             }
             else
             {
                 state = State.VIDEO_ENDED;
             }
         }
     });
     MaybeStartDemo();
 }
 void IYouTubePlayerOnInitializedListener.OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasResumed)
 {
     this.player = player;
     player.SetPlayerStyle(YouTubePlayerPlayerStyle.Chromeless);
     player.SetPlayerStateChangeListener(this);
     MaybeStartDemo();
 }
Ejemplo n.º 3
0
 public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool p2)
 {
     try
     {
         YoutubePlayer = player;
         YoutubePlayer.SetPlayerStyle(YouTubePlayerPlayerStyle.Default);
         YoutubePlayer.LoadVideo(VideoPlayid);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Ejemplo n.º 4
0
 public void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     if (!wasRestored && player != null)
     {
         YPlayer = player;
         YPlayer.SetFullscreen(false);
         YPlayer.SetPlayerStyle(YouTubePlayerPlayerStyle.Chromeless); // style
         seeker.ProgressChanged += Seeker_ProgressChanged;
         YPlayer.SetPlaybackEventListener(this);
         YPlayer.SetOnFullscreenListener(this);
         YPlayer.SetPlayerStateChangeListener(this);
         PlayVideo(element.VideoSource);
     }
 }
Ejemplo n.º 5
0
        // not emplemented
        public void OnFullscreen(bool p0)
        {
            fullScrean = p0;
            if (fullScrean)
            {
                MainActivity.Current.Window.AddFlags(WindowManagerFlags.Fullscreen);
            }
            else
            {
                MainActivity.Current.Window.AddFlags(WindowManagerFlags.TurnScreenOn);
            }

            YPlayer.SetPlayerStyle(fullScrean
                ? YouTubePlayerPlayerStyle.Minimal
                : YouTubePlayerPlayerStyle.Chromeless);
        }