示例#1
0
 public void ToggleFullScrean(object sender, EventArgs arg)
 {
     if (YPlayer.IsPlaying)
     {
         YPlayer.SetFullscreen(true);
     }
 }
示例#2
0
        public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
        {
            player1.SetFullscreen(false);

            FinishActivity(0);
            Finish();
            return(true);
        }
 public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool p2)
 {
     try
     {
         player.LoadVideo(idvideo);
         player.SetFullscreen(true);
         player.SetShowFullscreenButton(false);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#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);
     }
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.fullscreen_demo);

            baseLayout       = FindViewById <LinearLayout>(Resource.Id.layout);
            playerView       = FindViewById <YouTubePlayerView>(Resource.Id.player);
            fullscreenButton = FindViewById <Button>(Resource.Id.fullscreen_button);
            checkbox         = FindViewById <CompoundButton>(Resource.Id.landscape_fullscreen_checkbox);
            otherViews       = FindViewById(Resource.Id.other_views);

            checkbox.CheckedChange += (sender, e) =>
            {
                int controlFlags = player.FullscreenControlFlags;
                if (e.IsChecked)
                {
                    // If you use the FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE, your activity's normal UI
                    // should never be laid out in landscape mode (since the video will be fullscreen whenever the
                    // activity is in landscape orientation). Therefore you should set the activity's requested
                    // orientation to portrait. Typically you would do this in your AndroidManifest.xml, we do it
                    // programmatically here since this activity demos fullscreen behavior both with and without
                    // this flag).
                    RequestedOrientation = PortraitOrientation;
                    controlFlags        |= YouTubePlayer.FullscreenFlagAlwaysFullscreenInLandscape;
                }
                else
                {
                    RequestedOrientation = ScreenOrientation.Sensor;
                    controlFlags        &= ~YouTubePlayer.FullscreenFlagAlwaysFullscreenInLandscape;
                }
                player.FullscreenControlFlags = controlFlags;
            };

            fullscreenButton.Click += (sender, e) =>
            {
                player.SetFullscreen(!fullscreen);
            };

            playerView.Initialize(DeveloperKey.Key, this);

            DoLayout();
        }
 public void OnClick(View v)
 {
     player.SetFullscreen(!fullscreen);
 }