Disable full screen for youtube api

后端 未结 3 1838
后悔当初
后悔当初 2021-02-07 14:06

I have an app with fragments and inside those fragments I have frame layout into which I add YouTubePlayerSupportFragment. But when I click full screen then this exception is th

3条回答
  •  温柔的废话
    2021-02-07 15:11

    1. If you want to show full screen, youTubePlayer.setFullscreen(true);

    2. If you want to hide full screen button after full screen or even in the portrait mode the youTubePlayer.setShowFullscreenButton(false);

    3. You can also use PlayerStyle Option, provided in the newest API

    • YouTubePlayer.PlayerStyle.CHROMELESS A style that shows no interactive player controls. (No controls)

    • YouTubePlayer.PlayerStyle.DEFAULT The default style, showing all interactive controls. (All controls)

    • YouTubePlayer.PlayerStyle.MINIMAL A minimal style, showing only a time bar and play/pause controls. (can pause/play Only)

提交回复
热议问题