void IYouTubePlayerOnInitializedListener.OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasResumed)
 {
     this.player = player;
     player.SetPlayerStyle(YouTubePlayerPlayerStyle.Chromeless);
     player.SetPlayerStateChangeListener(this);
     MaybeStartDemo();
 }
 public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     if (!wasRestored)
     {
         player.CueVideo("wKJ9KzGQq0w");
     }
 }
Exemplo n.º 3
0
 public UserResponsePopup(string videoId, VideoController videoController, UserResponseFragment _responseFragment, IYouTubePlayer youtubePlayer = null)
 {
     VideoId          = videoId;
     VideoController  = videoController;
     YoutubePlayer    = youtubePlayer;
     ResponseFragment = _responseFragment;
 }
 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();
 }
Exemplo n.º 5
0
 public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool wasRestored)
 {
     if (!wasRestored)
     {
         player.CueVideo(youtubeItem.VideoId);
         player.Play();
     }
 }
 public void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     if (!wasRestored)
     {
         player.CueVideo("Uh_rSDdzubg");
         player.Play();
     }
 }
Exemplo n.º 7
0
 public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     if (!wasRestored)
     {
         player.CueVideo (_videoYouTubeId);
         SharedPreferencesHelper.Instance.AddVideoToSharedPreferences (_videoKey, SharedPreferenceType.Watched);
     }
 }
        public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
        {
            player.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagCustomLayout);
            player.SetOnFullscreenListener(this);

            if (!wasRestored) {
                player.CueVideo("9c6W4CCU9M4");
            }
        }
 public UserResponseBottomSheet(UserResponse response, string _videoId, PlayTube.Helpers.Controller.VideoController _videoController, UserResponseFragment _responseFragment
                                , IYouTubePlayer youtubePayer = null)
 {
     userResponse     = response;
     VideoController  = _videoController;
     YoutubePlayer    = youtubePayer;
     videoId          = _videoId;
     ResponseFragment = _responseFragment;
 }
Exemplo n.º 10
0
        public void OnInitializationSuccess(IYouTubePlayerProvider playerProvider, IYouTubePlayer player, bool wasRestored)
        {
            _player = player;
            _player.SetOnFullscreenListener (this);

            if (!wasRestored)
            {
                player.CueVideo (_videoId);
            }
        }
 void IYouTubePlayerOnInitializedListener.OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool restored)
 {
     this.player = player;
     player.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagCustomLayout);
     player.SetOnFullscreenListener((VideoListDemoActivity)Activity);
     if (!restored && videoId != null)
     {
         player.CueVideo(videoId);
     }
 }
 public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     this.player = player;
     SetControlsEnabled();
     // Specify that we want to handle fullscreen behavior ourselves.
     player.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagCustomLayout);
     player.SetOnFullscreenListener(this);
     if (!wasRestored) {
         player.CueVideo("avP5d16wEp0");
     }
 }
Exemplo n.º 13
0
 public void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     if (!wasRestored)
     {
         this.IsInitialized = true;
         this.Player        = player;
         this.Player.SetPlayerStateChangeListener(this);
         //player.CueVideo("o9P4B0iPHpI"); // Plays https://www.youtube.com/watch?v=o9P4B0iPHpI
         //player.LoadVideo("o9P4B0iPHpI");
     }
 }
Exemplo n.º 14
0
 public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     this.player = player;
     SetControlsEnabled();
     // Specify that we want to handle fullscreen behavior ourselves.
     player.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagCustomLayout);
     player.SetOnFullscreenListener(this);
     if (!wasRestored)
     {
         player.CueVideo("avP5d16wEp0");
     }
 }
        public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
        {
            this.player = player;
            player.SetPlaylistEventListener(playlistEventListener);
            player.SetPlayerStateChangeListener(playerStateChangeListener);
            player.SetPlaybackEventListener(playbackEventListener);

            if (!wasRestored)
            {
                PlayVideoAtSelection();
            }
            SetControlsEnabled(true);
        }
Exemplo n.º 16
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);
     }
 }
 public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool p2)
 {
     try
     {
         player.LoadVideo(idvideo);
         player.SetFullscreen(true);
         player.SetShowFullscreenButton(false);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 18
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);
     }
 }
Exemplo n.º 19
0
        void IYouTubePlayerPlayerStateChangeListener.OnError(YouTubePlayerErrorReason reason)
        {
            playerState = $"ERROR ({reason})";

            if (reason == YouTubePlayerErrorReason.UnexpectedServiceDisconnection)
            {
                // When this error occurs the player is released and can no longer be used.
                player = null;
                SetControlsEnabled(false);
            }

            UpdateText();
            Log(playerState);
        }
 void IYouTubePlayerPlayerStateChangeListener.OnError(YouTubePlayerErrorReason 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.VideoEnded;
     }
 }
Exemplo n.º 21
0
        public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool wasRestored)
        {
            try
            {
                if (YoutubePlayer == null)
                {
                    YoutubePlayer = player;
                }

                if (!wasRestored)
                {
                    YoutubePlayer.LoadVideo(PostObject.PostYoutube);
                    //YoutubePlayer.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagControlOrientation  | YouTubePlayer.FullscreenFlagControlSystemUi  | YouTubePlayer.FullscreenFlagCustomLayout);
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool wasRestored)
        {
            try
            {
                if (YoutubePlayer == null)
                {
                    YoutubePlayer = player;
                }

                if (!wasRestored)
                {
                    YoutubePlayer.LoadVideo(VideoIdYoutube);
                    //YoutubePlayer.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagControlOrientation  | YouTubePlayer.FullscreenFlagControlSystemUi  | YouTubePlayer.FullscreenFlagCustomLayout);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool wasRestored)
        {
            try
            {
                YoutubePlayer = YoutubePlayer switch
                {
                    null => player,
                    _ => YoutubePlayer
                };

                switch (wasRestored)
                {
                case false:
                    YoutubePlayer.LoadVideo(VideoIdYoutube);
                    //YoutubePlayer.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagControlOrientation  | YouTubePlayer.FullscreenFlagControlSystemUi  | YouTubePlayer.FullscreenFlagCustomLayout);
                    break;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Exemplo n.º 24
0
 public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     if (!wasRestored)
     {
         player.CueVideo("wKJ9KzGQq0w");
     }
 }
        public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
        {
            Player = player;
            Player.SetPlaylistEventListener(playlistEventListener);
            Player.SetPlayerStateChangeListener(playerStateChangeListener);
            Player.SetPlaybackEventListener(playbackEventListener);

            if (!wasRestored) {
                PlayVideoAtSelection();
            }
            SetControlsEnabled(true);
        }
 public virtual void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
 }
        public override void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
        {
            player.AddFullscreenControlFlag(YouTubePlayer.FullscreenFlagCustomLayout);
            player.SetOnFullscreenListener(this);

            if (!wasRestored)
            {
                player.CueVideo("9c6W4CCU9M4");
            }
        }
Exemplo n.º 28
0
 public void OnReady(IYouTubePlayer youTubePlayer)
 {
     tubePlayer = youTubePlayer;
     PlayNewVideo(YoutubeXamarin.VideoSource);
 }
Exemplo n.º 29
0
 public void OnError(IYouTubePlayer youTubePlayer, PlayerConstants.PlayerError error)
 {
     return;
 }
Exemplo n.º 30
0
 public void OnCurrentSecond(IYouTubePlayer youTubePlayer, float second)
 {
     return;
 }
Exemplo n.º 31
0
 public void OnApiChange(IYouTubePlayer youTubePlayer)
 {
     return;
 }
 public virtual void OnInitializationSuccess(IYouTubePlayerProvider provider, IYouTubePlayer player, bool wasRestored)
 {
     //throw new NotImplementedException ();
 }
Exemplo n.º 33
0
 public void OnVideoId(IYouTubePlayer youTubePlayer, string videoId)
 {
     return;
 }
Exemplo n.º 34
0
 public void OnVideoDuration(IYouTubePlayer youTubePlayer, float duration)
 {
     return;
 }
Exemplo n.º 35
0
 public void OnStateChange(IYouTubePlayer youTubePlayer, PlayerConstants.PlayerState state)
 {
     YoutubeXamarin.Estado = state.Name();
     return;
 }
Exemplo n.º 36
0
 public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer yPlayer, bool p2)
 {
     yPlayer.LoadVideo(vedioId, 0);
 }
Exemplo n.º 37
0
 public void OnVideoLoadedFraction(IYouTubePlayer youTubePlayer, float loadedFraction)
 {
     return;
 }
Exemplo n.º 38
0
 public YoutubeIoListeners(Activity mainContext, string videoPlayid, IYouTubePlayer iYoutubePlayer)
 {
     MainContext   = mainContext;
     VideoPlayid   = videoPlayid;
     YoutubePlayer = iYoutubePlayer;
 }