问题
My YouTube video shows an overflow menu, full screen, open in YouTube buttons from within the YouTubePlayerView
or the YouTubePlayerFragment
.
Is there any way to remove those items? I can't find anything in the docs.
Thanks.
回答1:
Add the style YouTubePlayer.PlayerStyle.CHROMELESS
in initialization to completely remove all available controls.
In onInitializationSuccess
add ytPlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.CHROMELESS);
.
Check here for more details.
Edit : You can add your own controls using either a DialogFragment or Dialog on top of the YoutubePlayer. This will allow you to control playback completely using your own buttons and seekbar. And it does the trick of removing Youtube App Button from player.
回答2:
Yes You can disable full screen from default player,You need to just use below code with your player object.
//To disable full screen mode.
player.setShowFullscreenButton(false);
Use above line to hide full screen button from your default youtube player.Hope this will work for you.
来源:https://stackoverflow.com/questions/35980341/removing-elements-from-within-the-youtubeplayerview-in-android