在Android的YouTubePlayerView中删除元素 [英] Removing elements from within the YouTubePlayerView in Android
问题描述
我的YouTube视频显示YouTubePlayerView
或YouTubePlayerFragment
内的全屏溢出菜单,并在YouTube按钮中打开.
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.
谢谢.
推荐答案
在初始化中添加样式 YouTubePlayer.PlayerStyle.CHROMELESS
以完全删除所有可用的控件.
Add the style YouTubePlayer.PlayerStyle.CHROMELESS
in initialization to completely remove all available controls.
在onInitializationSuccess
中添加ytPlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.CHROMELESS);
.
此处有关更多详细信息.
您可以使用YoutubePlayer顶部的DialogFragment或Dialog添加自己的控件.这将使您可以使用自己的按钮和搜索栏完全控制播放.并实现了从播放器中删除Youtube应用按钮的技巧.
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.
这篇关于在Android的YouTubePlayerView中删除元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!