試試這個
在你onInitializationSuccess方法使用此代碼
player.setPlayerStyle(YouTubePlayer.PlayerStyle.CHROMELESS);
的完整代碼
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider,
YouTubePlayer player, boolean wasRestored) {
if (!wasRestored) {
// loadVideo() will auto play video
// Use cueVideo() method, if you don't want to play it automatically
player.loadVideo(Config.YOUTUBE_VIDEO_CODE);
// Hiding player controls
player.setPlayerStyle(YouTubePlayer.PlayerStyle.CHROMELESS);
//player.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);
}
}
注: -
1.顯示所有的交互式控制
公共靜態最終YouTubePlayer.PlayerStyle DEFAULT
2.對於隱藏所有交互式控件
公衆static final YouTubePlayer.PlayerStyle CHROMELESS
3.對於只顯示時間欄和播放/暫停控制
公共靜態最終YouTubePlayer.PlayerStyle極小
有關詳情,請訪問官方link
但我想YouTubePlayer.PlayerStyle.DEFAULT的所有控件除「YouTube」的按鈕。如何在Android中執行此操作。這是可行的在iOS和Javascript。 – GreenRobo